https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84130
Bug ID: 84130 Summary: excessive compile time with -O1 Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: dcb314 at hotmail dot com Target Milestone: --- Created attachment 43293 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43293&action=edit gzipped C++ source code For the attached C++ code and the following shell script time /home/dcb/gcc/results.257131.release/bin/g++ -O0 -w -c bug415.cc time /home/dcb/gcc/results.257131.release/bin/g++ -O1 -w -c bug415.cc time /home/dcb/gcc/results.257131.release/bin/g++ -O2 -w -c bug415.cc With a release build of gcc trunk revision 257131, I got the following numbers: real 0m29.298s user 0m28.299s sys 0m0.724s real 1m56.663s user 1m54.380s sys 0m1.157s real 3m7.535s user 3m5.559s sys 0m1.065s Going from -O0 to -O1 seems excessive. -ftime-report seems to suggest most of the time is spent in phase opt and generate : 110.71 (97%) usr 5.84 (85%) sys 117.63 (96%) wall 2 972042 kB (88%) ggc