]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rtl-optimization/105559 - avoid quadratic behavior in delete_insn_and_edges
authorRichard Biener <rguenther@suse.de>
Wed, 11 May 2022 11:34:37 +0000 (13:34 +0200)
committerRichard Biener <rguenther@suse.de>
Wed, 11 May 2022 12:34:30 +0000 (14:34 +0200)
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.

gcc/cfgrtl.cc

index 74ea14efc61539495449c1ddb499d804ca8cb763..06be46d75df5ec42557db6f13b7702cb2f20544b 100644 (file)
@@ -235,7 +235,7 @@ delete_insn_and_edges (rtx_insn *insn)
 {
   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)