* c-typeck.c (digest_init): Fold init expression.
authorAlan Modra <alan@linuxcare.com.au>
Tue, 27 Mar 2001 06:03:40 +0000 (06:03 +0000)
committerAlan Modra <amodra@gcc.gnu.org>
Tue, 27 Mar 2001 06:03:40 +0000 (15:33 +0930)
From-SVN: r40867

gcc/ChangeLog
gcc/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20010327-1.c [new file with mode: 0644]

index 51c4dbdc92782571053809caf36feb8f2aa50917..17590b26fe84b530a70c8bda1b9557eb0dc4159d 100644 (file)
@@ -1,3 +1,7 @@
+2001-03-27  Alan Modra  <alan@linuxcare.com.au>
+
+       * c-typeck.c (digest_init): Fold init expression.
+
 2001-03-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * sbitmap.c (sbitmap_copy): Call memcpy, not bcopy.
index 1ff44d213693ac5db94b3cbf5af0e89e6aac09b2..508045b497982ce2a392f5d80c7dbd3306a37dc9 100644 (file)
@@ -4675,6 +4675,8 @@ digest_init (type, init, require_constant, constructor_constant)
   if (TREE_CODE (init) == NON_LVALUE_EXPR)
     inside_init = TREE_OPERAND (init, 0);
 
+  inside_init = fold (inside_init);
+
   /* Initialization of an array of chars from a string constant
      optionally enclosed in braces.  */
 
index 86736d39462533247f1fcde163494a4d280242d3..dbebcacb6c283f18d333561209dcd1a0de729253 100644 (file)
@@ -1,3 +1,7 @@
+2001-03-27  Alan Modra  <alan@linuxcare.com.au>
+
+       * gcc.c-torture/compile/20010327-1.c: New test.
+
 2001-03-26  Nathan Sidwell  <nathan@codesourcery.com>
 
        * g++.old-deja/g++.other/friend12.C: New test.
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010327-1.c b/gcc/testsuite/gcc.c-torture/compile/20010327-1.c
new file mode 100644 (file)
index 0000000..fc31a6e
--- /dev/null
@@ -0,0 +1,2 @@
+extern void _text;
+static unsigned long x = (unsigned long) &_text - 0x10000000L - 1;