This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

New testcase


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]);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]