https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119015
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2025-02-26 Known to fail| |14.2.0, 15.0 Known to work| |13.3.0 Status|UNCONFIRMED |NEW Target Milestone|--- |14.3 Ever confirmed|0 |1 Summary|[14 Regression] g++ -O2 |[14/15 Regression] g++ -O2 |uses huge amounts of time |uses huge amounts of time |and memory |and memory --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- On x86-64 while -O2 is a lot slower it seems to not use a lot more memory (just 30% more than -Os or -O1). > /usr/bin/time /space/rguenther/install/gcc-14.2/bin/g++ -S > MarbleAboutDialog.ii -Os 1.92user 0.07system 0:02.02elapsed 99%CPU (0avgtext+0avgdata 352996maxresident)k 2688inputs+1904outputs (4major+75433minor)pagefaults 0swaps > /usr/bin/time /space/rguenther/install/gcc-14.2/bin/g++ -S > MarbleAboutDialog.ii -O2 12.58user 0.17system 0:12.77elapsed 99%CPU (0avgtext+0avgdata 457364maxresident)k 1944inputs+2096outputs (6major+105247minor)pagefaults 0swaps offenders are: alias stmt walking : 1.71 ( 13%) tree DSE : 2.32 ( 18%) store merging : 1.65 ( 13%) TOTAL : 13.10 given -Os isn't affected this is likely triggered by inlining (-fno-inline brings down compile-time again). GCC 15 behaves similarly.