https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111515
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Looks like an early jump threading happens in n and then the size differences causes inlining heurstics not to chose the function for inlining because it is inlining into `main`. If we change main to `f` or `main1`, then n is inlined and there is no missed optimization ...