This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
New testcase
- To: gcc-patches at gcc dot gnu dot org
- Subject: New testcase
- From: Bernd Schmidt <bernds at redhat dot com>
- Date: Tue, 14 Nov 2000 13:22:21 +0000 (GMT)
I'd like to install the testcase below in gcc.c-torture/compile. It
demonstrates a problem we have with constant folding. GCC 2.95 compiles
it without a problem, while current CVS fails.
The third line contains an expression that is common in glibc's string
function macros. I'm not actually sure it's valid C (can someone tell
for certain?) but it would make sense to make it a GNU C extension if
it isn't.
I submitted a patch to fold-const.c a while ago to fix this problem,
but unfortunately that patch makes the second line (which is from
newlib/libc/stdlib/mallocrs.c) fail.
Bernd
int x[60];
char *y = ((char*)&(x[2*8 + 2]) - 8);
int z = (&"Foobar"[1] - &"Foobar"[0]);