aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/c-typeck.c2
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20010327-1.c2
4 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 51c4dbd..17590b2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 1ff44d2..508045b 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -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. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 86736d3..dbebcac 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..fc31a6e
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20010327-1.c
@@ -0,0 +1,2 @@
+extern void _text;
+static unsigned long x = (unsigned long) &_text - 0x10000000L - 1;