Bug 77532 - gcc hang on compilation with -O2 but fine with just -g
gcc hang on compilation with -O2 but fine with just -g
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
8.0
athlon Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-11-08 12:28 EST by matt bettencourt
Modified: 2007-04-18 12:48 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-03 06:24:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
strace output of hang... (3.66 KB, text/plain)
2002-11-13 12:33 EST, Michael Lee Yohe
no flags Details

  None (edit)
Description matt bettencourt 2002-11-08 12:28:01 EST
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 12:32:47 EST
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 12:33:27 EST
Created attachment 84844 [details]
strace output of hang...
Comment 3 Michael Lee Yohe 2002-11-13 12:34:48 EST
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 05:13:34 EST
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 06:24:20 EDT
404: File not found.
Attach files rather than pointing to ephemeral external urls.

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