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 <rguenther@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)
{
bool purge = false;
- if (INSN_P (insn) && BLOCK_FOR_INSN (insn))
+ if (NONDEBUG_INSN_P (insn) && BLOCK_FOR_INSN (insn))
{
basic_block bb = BLOCK_FOR_INSN (insn);
if (BB_END (bb) == insn)