Created attachment 111145 [details] preprocessed source to trigger the bug
Description of problem: SIGSEGV Version-Release number of selected component (if applicable): I'm actually using upstream gcc trunk as of 2005-02-14. How reproducible: 100% Steps to Reproduce: 1. /usr/local/libexec/gcc/i686-pc-linux-gnu/4.0.0/cc1 -fpreprocessed string-inlines.i -quiet -dumpbase string-inlines.c -march=i686 -mtune=pentium4 -mpreferred-stack-boundary=2 -auxbase-strip /home/roland/build/gcc4-libc/string/string-inlines.o -g -O3 -Wall -Winline -Wstrict-prototypes -Wwrite-strings -std=gnu99 -version -o string-inlines.s 2. 3. Actual results: GNU C version 4.0.0 20050214 (experimental) (i686-pc-linux-gnu) compiled by GNU C version 3.3.3 20040412 (Red Hat Linux 3.3.3-7). GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 ../sysdeps/i386/i486/bits/string.h: In function '__strcat_c': ../sysdeps/i386/i486/bits/string.h:1000: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. Expected results: Additional info: No crash under -O2.
Simplified testcase at -g -O{1,2,3}: typedef __SIZE_TYPE__ size_t; inline void * foo (void *x, const void *y, size_t z) { register unsigned long int c; __asm__ __volatile__ ("" : "=&r" (c), "=m" (*(struct { __extension__ char d[z]; } *) x) : "0" (y), "m" (*(struct { __extension__ char d[z]; } *) y)); return x; } char * bar (char *x, const char y[], size_t z) { foo (x, y, z); return x; }
Even: inline void * foo (void *x, unsigned long y) { __asm__ __volatile__ ("" : "=m" (*(struct { __extension__ char d[y]; } *) x) : "r" (x)); return x; } char * bar (char *x, unsigned long y) { foo (x, y); return x; }
This seems to be the same as PR19345.
Should be worked around in gcc-4.0.0-0.33.