]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rtl-ssa: Don't insert after insns that can throw
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 24 Oct 2023 10:30:53 +0000 (11:30 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 24 Oct 2023 10:30:52 +0000 (11:30 +0100)
rtl_ssa::can_insert_after didn't handle insns that can throw.
Fixing that avoids a regression with a later patch.

gcc/
* rtl-ssa.h: Include cfgbuild.h.
* rtl-ssa/movement.h (can_insert_after): Replace is_jump with the
more comprehensive control_flow_insn_p.

gcc/rtl-ssa.h
gcc/rtl-ssa/movement.h

index 7355c6c446365cdd879fcaae868f656b2571172d..3a3c8b50ee2d6f7f31f4bf5589f08c56770dbdb2 100644 (file)
@@ -49,6 +49,7 @@
 #include "obstack-utils.h"
 #include "mux-utils.h"
 #include "rtlanal.h"
+#include "cfgbuild.h"
 
 // Provides the global crtl->ssa.
 #include "memmodel.h"
index d9945f491723236499c6e67c68a02b7c41583570..67370947dbde0fa993b131c1796061d4ad8bf457 100644 (file)
@@ -61,7 +61,8 @@ move_earlier_than (insn_range_info range, insn_info *insn)
 inline bool
 can_insert_after (insn_info *insn)
 {
-  return insn->is_bb_head () || (insn->is_real () && !insn->is_jump ());
+  return (insn->is_bb_head ()
+         || (insn->is_real () && !control_flow_insn_p (insn->rtl ())));
 }
 
 // Try to restrict move range MOVE_RANGE so that it is possible to