https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28850
--- Comment #10 from rguenther at suse dot de <rguenther at suse dot de> --- On Fri, 29 Aug 2025, pinskia at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28850 > > --- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> --- > (In reply to rguent...@suse.de from comment #8) > > Esp. since full EH cleanup can be quite expensive. Can we split out > > cheap parts, possibly doing them from DCE? > > So DCE might be too "early" in some cases. > In comment #0 the eh landing pad only becomes empty after remove_unused_locals > is run (after DCE). so running inside DCE would be too early. Unless we change > how we do the TODO in DCE. > > So I was thinking doing it as part of remove_unused_locals . > But I won't know until I try it out fully. The other alternative would be CFG cleanup, if we can get this removal into the O(CFG size) rather than O(stmt count) complexity regime. Aka only look at last stmts (even gsi_*_nondebug wouldn't qualify).