Bug 148934 - cc1 crash building glibc i486 string inlines under -O3
cc1 crash building glibc i486 string inlines under -O3
Product: Fedora
Classification: Fedora
Component: gcc4 (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2005-02-16 20:04 EST by Roland McGrath
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version: 4.0.0-0.33
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-03-11 19:16:38 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
preprocessed source to trigger the bug (70.06 KB, text/plain)
2005-02-16 20:04 EST, Roland McGrath
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 19345 None None None Never

  None (edit)
Description Roland McGrath 2005-02-16 20:04:02 EST
Created attachment 111145 [details]
preprocessed source to trigger the bug
Comment 1 Roland McGrath 2005-02-16 20:04:02 EST
Description of problem:

Version-Release number of selected component (if applicable):

I'm actually using upstream gcc trunk as of 2005-02-14.

How reproducible:

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

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.
Comment 2 Jakub Jelinek 2005-02-17 06:02:08 EST
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;
Comment 3 Jakub Jelinek 2005-02-17 06:04:49 EST
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;
Comment 4 Jakub Jelinek 2005-02-17 06:14:34 EST
This seems to be the same as PR19345.
Comment 5 Jakub Jelinek 2005-03-11 19:16:38 EST
Should be worked around in gcc-4.0.0-0.33.

Note You need to log in before you can comment on or make changes to this bug.