Description of problem: GCC chokes on some C++ code. Version-Release number of selected component (if applicable): gcc-c++-4.1.0-3 How reproducible: Every time. Steps to reproduce: Compile attached source with the following command: g++ -c nmtest.cpp -funroll-loops -O2 -o nmtest.o Actual results: Crash with the following output: nmtest.cpp: In function âint main()â: nmtest.cpp:293: internal compiler error: in get_loop_body, at cfgloop.c:799 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugzilla.redhat.com/bugzilla> for instructions. Preprocessed source stored into /tmp/ccGuOWMs.out file, please attach this to your bugreport. Expected results: Compiled code. Additional info: This is using ccache but I don't expect that it has anything to do with this. I have wiped the cache and rebuilt from scratch with the same results. I will attach some code in a follow up comment. The preprocessor output is attached here.
Created attachment 128274 [details] Preprocessor output from GCC
Created attachment 128275 [details] Test case
The bug only triggers with combination of -funroll-loops and -O2. Use only one flag or the other on its own and the code compiles fine.
Tracking upstream.