https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64744
--- Comment #5 from ktkachov at gcc dot gnu.org --- (In reply to Alexander Basov from comment #4) > (In reply to ktkachov from comment #3) > > Confirmed as well on all release branches. > > Ok, If you have no any objections, I'd like to fix it. > > BTW, what gcc should do with such code? Patches welcome :) Though I note the ICE only happens at -O0 and disappears if you enable any optimisation. According to: https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html the 'naked' attribute will omit the prologue/epilogue of the function but it's supposed to be used only with inline asm and C code is not expected to work reliably. That being said, we should never ICE...