http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54146
Bug #: 54146 Summary: Very slow compile at -O1 (expand vars) Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassig...@gcc.gnu.org ReportedBy: gli...@gcc.gnu.org Created attachment 27912 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27912 testcase Hello, trying to compile the attached program on x86_64, g++ slow.cc -frounding-math -c -w -O2 fails after about an hour. The memory consumption (as shown by top) never went above 1.5G. clang compiles the whole thing in 1 minute (well, it won't compile the preprocessed source attached here, but the original program). If you remove most of the check<...> lines at then end (keep only the first one), the program takes about 10s to compile at -O0, and 30s at -O1 (or -O2, -O3), with 2/3 of the time spent in "expand vars" according to -ftime-report. The most relevant report I found in bugzilla is PR 38474, but it seems to say that expand vars should be fast now...