Bug 448273

Summary: g++ goes into an endless loop
Product: [Fedora] Fedora Reporter: Hans de Goede <hdegoede>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-29 10:58:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
gzipped (huge) laby.cpp none

Description Hans de Goede 2008-05-25 09:13:58 UTC
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 09:13:58 UTC
Created attachment 306602 [details]
gzipped (huge) laby.cpp