https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117423
--- Comment #19 from Andrew Pinski <pinskia at gcc dot gnu.org> --- For emacs the easiest work around is add: __attribute__((noipa)) static void workaround_sink (void *) {} and then inside kbd_buffer_store_event_hold add: workaround_sink(event); right before the call of kbd_buffer_store_buffered_event. Or if you wanted a more isolated fix is add: workaround_sink (&ie); right before the call to: kbd_buffer_store_event (&ie); that was added in commit d41178368eb73873f34c15b58062a7447802c914 . This forces SRA not to happen for IE variable around the call of workaround_sink and allows SRA still do most of the job.