Bug 148934 - cc1 crash building glibc i486 string inlines under -O3
Summary: cc1 crash building glibc i486 string inlines under -O3
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc4
Version: rawhide
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-02-17 01:04 UTC by Roland McGrath
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 4.0.0-0.33
Clone Of:
Environment:
Last Closed: 2005-03-12 00:16:38 UTC
Type: ---
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 19345 0 None None None Never

Description Roland McGrath 2005-02-17 01:04:02 UTC
Created attachment 111145 [details]
preprocessed source to trigger the bug

Comment 1 Roland McGrath 2005-02-17 01:04:02 UTC
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.

Comment 2 Jakub Jelinek 2005-02-17 11:02:08 UTC
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 11:04:49 UTC
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;
}


Comment 4 Jakub Jelinek 2005-02-17 11:14:34 UTC
This seems to be the same as PR19345.

Comment 5 Jakub Jelinek 2005-03-12 00:16:38 UTC
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.