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.
Created attachment 306602 [details] gzipped (huge) laby.cpp