+2009-11-04 Jason Merrill <jason@redhat.com>
+
+ PR c++/36912
+ * varasm.c (initializer_constant_valid_p): A PLUS_EXPR
+ or MINUS_EXPR of REAL_TYPE is not a valid constant initializer.
+ (output_constant): Avoid crash after error.
+
2009-11-05 Martin Jambor <mjambor@suse.cz>
* tree-sra.c (struct access): Changed comment of next_sibling field.
case POINTER_PLUS_EXPR:
case PLUS_EXPR:
+ /* Any valid floating-point constants will have been folded by now;
+ with -frounding-math we hit this with addition of two constants. */
+ if (TREE_CODE (endtype) == REAL_TYPE)
+ return NULL_TREE;
if (! INTEGRAL_TYPE_P (endtype)
|| TYPE_PRECISION (endtype)
>= int_or_pointer_precision (TREE_TYPE (value)))
break;
case MINUS_EXPR:
+ if (TREE_CODE (endtype) == REAL_TYPE)
+ return NULL_TREE;
if (! INTEGRAL_TYPE_P (endtype)
|| TYPE_PRECISION (endtype)
>= int_or_pointer_precision (TREE_TYPE (value)))
case REAL_TYPE:
if (TREE_CODE (exp) != REAL_CST)
error ("initializer for floating value is not a floating constant");
-
- assemble_real (TREE_REAL_CST (exp), TYPE_MODE (TREE_TYPE (exp)), align);
+ else
+ assemble_real (TREE_REAL_CST (exp), TYPE_MODE (TREE_TYPE (exp)), align);
break;
case COMPLEX_TYPE: