https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101813
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Target Milestone|--- |14.0 Resolution|--- |FIXED --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- GCC considers main as called once only so it inlines less into it (without being inside a loop). So changing main to f (and adding a `return 0;` at the end), GCC is also able to optimize the code. Also on the trunk GCC is able to optmize the code out even without changing the name due to improvements to the inlining heuristics. So closing as fixed for GCC 14. (and could have been closed as won't fix for before GCC 13 too before too).