aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2023-10-24 11:30:53 +0100
committerRichard Sandiford <richard.sandiford@arm.com>2023-10-24 11:30:52 +0100
commitd0eb4aceaa93eabd6153853b22e0e8c843de4184 (patch)
tree3d526fbd46a6b2dacaf92cbba721187f580014e1
parentc97b167e35774e5add4d1079b552383d3fea62dc (diff)
rtl-ssa: Don't insert after insns that can throw
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.
-rw-r--r--gcc/rtl-ssa.h1
-rw-r--r--gcc/rtl-ssa/movement.h3
2 files changed, 3 insertions, 1 deletions
diff --git a/gcc/rtl-ssa.h b/gcc/rtl-ssa.h
index 7355c6c4463..3a3c8b50ee2 100644
--- a/gcc/rtl-ssa.h
+++ b/gcc/rtl-ssa.h
@@ -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"
diff --git a/gcc/rtl-ssa/movement.h b/gcc/rtl-ssa/movement.h
index d9945f49172..67370947dbd 100644
--- a/gcc/rtl-ssa/movement.h
+++ b/gcc/rtl-ssa/movement.h
@@ -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