From b13aca193b0d72af3a249cabe0951ba39a60b693 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 27 Mar 2001 06:03:40 +0000 Subject: [PATCH] * c-typeck.c (digest_init): Fold init expression. From-SVN: r40867 --- gcc/ChangeLog | 4 ++++ gcc/c-typeck.c | 2 ++ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.c-torture/compile/20010327-1.c | 2 ++ 4 files changed, 12 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/compile/20010327-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 51c4dbdc927..17590b26fe8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2001-03-27 Alan Modra + + * c-typeck.c (digest_init): Fold init expression. + 2001-03-26 Kaveh R. Ghazi * sbitmap.c (sbitmap_copy): Call memcpy, not bcopy. diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 1ff44d21369..508045b4979 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 86736d39462..dbebcacb6c2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2001-03-27 Alan Modra + + * gcc.c-torture/compile/20010327-1.c: New test. + 2001-03-26 Nathan Sidwell * 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 00000000000..fc31a6e68c2 --- /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; -- 2.30.2