Bug 28592

Summary: [4.0 regression] Segmentation Fault running -O2 on file with deep nesting
Product: gcc Reporter: Rob Ennals <rob>
Component: cAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs
Priority: P3    
Version: 4.0.3   
Target Milestone: 4.1.0   
Host: Target:
Build: Known to work: 4.1.0 4.0.0 4.0.1 4.0.2 4.0.4
Known to fail: 4.0.3 Last reconfirmed: 2006-08-04 11:34:25
Attachments: Running gcc -O2 on this file gives a segfault.

Description Rob Ennals 2006-08-04 00:26:06 UTC
Running GCC with -O2 enabled on the attached file causes a segmentation fault. This file was reduced from a much bigger file using delta.

robennals@robennals:~/cvs/Ivy/deputytests/minim$ gcc --version
gcc (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

robennals@robennals:~/cvs/Ivy/deputytests/minim$ gcc -O2 t.c
t.c:29: warning: ‘struct envelope’ declared inside parameter list
t.c:29: warning: its scope is only this definition or declaration, which is probably not what you want
t.c: In function ‘sendall’:
t.c:30: 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.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.0/README.Bugs>
Comment 1 Rob Ennals 2006-08-04 00:27:32 UTC
Created attachment 12012 [details]
Running gcc -O2 on this file gives a segfault.

Tested using gcc (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5), the standard GCC build that comes with Ubuntu.
Comment 2 Martin Michlmayr 2006-08-04 11:34:25 UTC
I can confirm this on i386 with 4.0.4 20060804.
Comment 3 Richard Biener 2007-02-01 14:41:13 UTC
This seems to be fixed now.  (tested on x86_64 with -m32)
Comment 4 Gabriel Dos Reis 2007-02-03 18:42:57 UTC
Fixed in GCC-4.1.0.