https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54089
--- Comment #81 from Alexander Klepikov <klepikov.alex+bugs at gmail dot com> --- (In reply to Oleg Endo from comment #78) > The compiler processes one function at a time, all passes at once. It > doesn't mix passes of different functions. So I think using global variable > in sh.cc + override 'set_current_function' should get the job done. When > the insn split code is executed, just set the global flag in the SH specific > function context. I made a proof of concept using a global variable only. It is defined in sh.cc and it is defined as extern in sh_loop.cc. It is set when splitting is done and it is cleared when sh_loop_done is called, i.e. at the end of loop optimization. Do we really need 'set_current_function'? Because so far it seems a little excessive.