Bug 448273 - g++ goes into an endless loop
Summary: g++ goes into an endless loop
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-05-25 09:13 UTC by Hans de Goede
Modified: 2008-05-29 10:58 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-29 10:58:39 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
gzipped (huge) laby.cpp (321.36 KB, application/octet-stream)
2008-05-25 09:13 UTC, Hans de Goede
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 36365 0 None None None Never

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


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