Revert untested varasm.c change
authorJason Merrill <jason@gcc.gnu.org>
Wed, 4 Nov 2009 23:14:56 +0000 (18:14 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 4 Nov 2009 23:14:56 +0000 (18:14 -0500)
From-SVN: r153923

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/init/static-init2.C [deleted file]
gcc/varasm.c

index 4d7fe5ff3a07e0db508976dd532d6b086b76fb3c..38a62e2fa0f6a3daf06ecf2ad3fbc2e1344fac14 100644 (file)
@@ -1,10 +1,3 @@
-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
index b65593ed0f954d48dc0fce95dc5b3dbb4d3e8684..61f8450e081aa077064c10cbad96cdc804406be4 100644 (file)
@@ -1,8 +1,3 @@
-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
diff --git a/gcc/testsuite/g++.dg/init/static-init2.C b/gcc/testsuite/g++.dg/init/static-init2.C
deleted file mode 100644 (file)
index 34bf2b2..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-// PR c++/36912
-// { dg-options -frounding-math }
-const double c = .1, d = c+1;
index c9953d128da8d358644bb4c0d2afe15bcdb320b7..b6ff4ae149dd0311326c5a94f23ceeb2cbce6206 100644 (file)
@@ -4322,10 +4322,6 @@ initializer_constant_valid_p (tree value, tree endtype)
 
     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)))
@@ -4349,8 +4345,6 @@ initializer_constant_valid_p (tree value, tree endtype)
       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)))
@@ -4566,8 +4560,8 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align)
     case REAL_TYPE:
       if (TREE_CODE (exp) != REAL_CST)
        error ("initializer for floating value is not a floating constant");
-      else
-       assemble_real (TREE_REAL_CST (exp), TYPE_MODE (TREE_TYPE (exp)), align);
+
+      assemble_real (TREE_REAL_CST (exp), TYPE_MODE (TREE_TYPE (exp)), align);
       break;
 
     case COMPLEX_TYPE: