Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 77532

Summary: gcc hang on compilation with -O2 but fine with just -g
Product: [Retired] Red Hat Linux Reporter: matt bettencourt <matt>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED WONTFIX QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: michael
Target Milestone: ---   
Target Release: ---   
Hardware: athlon   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-03 10:24:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
strace output of hang... none

Description matt bettencourt 2002-11-08 17:28:01 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021017

Description of problem:
gcc on a RH8.0 system (fully patched) hangs on compilation of a 126 line file
(5K fully preprocessed) when you compile with -g -O2 but is fine with -g only. 
The preprocessed file hangs on a RH7.3 system with both gcc3 and gcc 
8.0 system
rpm -q gcc
gcc-3.2-7

7.3 system
{attica} 155 % rpm -q gcc3
gcc3-3.0.4-1
{attica} 156 % rpm -q gcc
gcc-2.96-112


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


How reproducible:
Always

Steps to Reproduce:
1.get file at ftp://attica.ssc.usm.edu:2121/pub/matt/gccbug.c
2.gcc -O2 -g gccbug.c
3. wait . . . . . .
	

Actual Results:  Hangs on step 2

Expected Results:  get a .o file or error

Additional info:

Comment 1 Michael Lee Yohe 2002-11-13 17:32:47 UTC
There a missing header files to be able to compile this source from start to
finish.  But your sole source file does indeed hang on -O2, but not -O1 or -g. 
I'll add an strace output attachment.

Comment 2 Michael Lee Yohe 2002-11-13 17:33:27 UTC
Created attachment 84844 [details]
strace output of hang...

Comment 3 Michael Lee Yohe 2002-11-13 17:34:48 UTC
Infinite loop, perhaps?  Strange that there is nothing being flooded to strace.
 7908 myohe     25   0 10684  10M  2184 R    92.2  1.3   0:30 cc1
                                             ^^^^

Comment 4 Jakub Jelinek 2002-11-14 10:13:34 UTC
Doesn't look like 5K preprocessed, more like 88K one function which causes
problems, with > 1000 if statements.
It seems like a bug in strength reduction (happens in gcc 3.3 20021113 too),
so for now you could get around this with -fno-strength-reduce.
Will try to simplify this testcase before debugging.

Comment 5 Richard Henderson 2004-10-03 10:24:20 UTC
404: File not found.
Attach files rather than pointing to ephemeral external urls.