https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119491
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org, | |rguenth at gcc dot gnu.org --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I think it would be useful to do one cleanup_eh far earlier after IPA, right now we have cleanup_eh before IPA (but after tailr) and another one only a few passes after tailc almost at the end of GIMPLE passes. Inlining can introduce cases where EH needs to be cleaned up and perhaps the lack of that hurts even other optimizations than just tailc. So perhaps around vrp1 (i.e. after some cleanups of the post IPA IL (ccp, forwprop, fre))? Another possibility is what you have but have a special version of the pass guarded on cfun->has_musttail (though that won't help other tail calls, just musttail). Or yet another possibility is not to handle musttail calls during tailc (so, pretty much set diag_musttail only in musttail; then it would be the same thing as only_musttail and could be merged into just one flag) pass and do it always in the musttail pass. This won't help tail calls other than musttail as well. Now the second or third option are maybe slightly safer this late in stage4, but perhaps we have still time to add another cleanup_eh. Richi, what do you think about this?