Bug 448273 - g++ goes into an endless loop
g++ goes into an endless loop
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-25 05:13 EDT by Hans de Goede
Modified: 2008-05-29 06:58 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-29 06:58:39 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)
gzipped (huge) laby.cpp (321.36 KB, application/octet-stream)
2008-05-25 05:13 EDT, Hans de Goede
no flags Details


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

  None (edit)
Description Hans de Goede 2008-05-25 05:13:58 EDT
Description of problem:
g++ goes into an endless loop when compiling the attached .cpp file (laby.cpp)
with optimizations I originally tried compiling it with "$RPM_OPT_FLAGS", but
adding just -O1 is enough to make g++ hang. It compiles fine without
optimalizations. To be clear, this works fine:
g++ -S laby.cpp -I/usr/include/SDL -o laby.asm
And this hangs:
g++ -O1 -S laby.cpp -I/usr/include/SDL -o laby.asm

I'm using -S as I wanted to make sure it was the compiler and not the assembler
hanging.


Version-Release number of selected component (if applicable):
gcc-4.3.0-8.x86_64

How reproducible:
Always

Steps to Reproduce:
1. yum install SDL_mixer-devel
2. save attached laby.cpp.gz
3. gzip -d laby.cpp.gz
4. g++ -S laby.cpp -I/usr/include/SDL -o laby.asm
  
Actual results:
g++ hangs

Expected results:
g++ compiles laby.cpp


Additional info:
I've tried finding which part of the optimizations break it by adding
-fno-foo-bar options. But even after adding enough options to get the
/usr/libexec/gcc/x86_64-redhat-linux/4.3.0/cc1plus --help=optimizers
output identical for the call with and without -O1 it still hangs.


Background info:
Yes I know laby.cpp is _huge_. Here is the story behind it, I'm working on
packaging Lost Labyrinth for Fedora, a Free game written in PureBasic.

Recently someone has written a Free PureBasic compiler / translator called elice
which translates PureBasic to c++ code, laby.cpp is the output of elice for Lost
Labyrinth. Unfortunately even though Lost Labyrinth consists of many separate
PureBasic files, elice generates one .cpp file. When not using optimization this
file compiles and works fine, when I tried to use $RPM_OPT_FLAGS I got this hang.
Comment 1 Hans de Goede 2008-05-25 05:13:58 EDT
Created attachment 306602 [details]
gzipped (huge) laby.cpp

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