https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62144
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> --- The documentation on -fomit-frame-pointer says: "Don't keep the frame pointer in a register for functions that don't need one." where whether soemthing needs a frame pointer or not is not precisely defined (exactly because the actual check in the compiler whether something needs a frame pointer or not is not really something simple, and depends on many things). Whether we can avoid frame pointer on this exact testcase is something Vlad can perhaps look at, my answer was just general.