https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115049
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> --- -fipa-ra sounds like a likely culprit: Use caller save registers for allocation if those registers are not used by any called function. In that case it is not necessary to save and restore them around calls. This is only possible if called functions are part of same compilation unit as current function and they are compiled before it.