https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105559
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:2a040e982945a5795081e81be35094b604d596d3 commit r12-8399-g2a040e982945a5795081e81be35094b604d596d3 Author: Richard Biener <rguent...@suse.de> Date: Wed May 11 13:34:37 2022 +0200 rtl-optimization/105559 - avoid quadratic behavior in delete_insn_and_edges When the insn to delete is a debug insn there's no point in figuring out whether it might be the last real insn and thus we have to purge dead edges. 2022-05-11 Richard Biener <rguent...@suse.de> PR rtl-optimization/105559 * cfgrtl.cc (delete_insn_and_edges): Only perform search to BB_END for non-debug insns. (cherry picked from commit 37a8220fa9188470c677abfef50c1b120c0b6c76)