+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-04 Eric Botcazou <ebotcazou@adacore.com>
PR target/10127
2009-11-04 Jason Merrill <jason@redhat.com>
+ PR c++/36912
+ * g++.dg/init/static-init2.C: New.
+
+2009-11-04 Jason Merrill <jason@redhat.com>
+
PR c++/39413
* g++.dg/template/overload11.C: New.
* g++.dg/template/nested3.C: Adjust.
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: