https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28850
--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to rguent...@suse.de from comment #10) > 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). I don't think we can because then we need to be 100% sure there can never be any debug statements there; I am not too comfortable in saying that. A simplified version in remove_unused_locals should be enough for most of the time, remove_unused_locals 6 times. after into ssa einline ... DCE ... --- pass_cleanup_eh -- tail_re inline ... DCE ... -- tail_re ... DCE -- tail call ... cleanup_cfg_post_optimizing (optimized) --- pass_cleanup_eh So I suspect this should be enough.