From: Trevor Saunders <[email protected]>
gcc/ChangeLog:
* rtl.h (CROSSING_JUMP_P, set_crossing_jump): Use functions on an
rtx_insn *.
* bb-reorder.cc (update_crossing_jump_flags): Use
set_crossing_jump to store the flag.
* cfgrtl.cc (fixup_partition_crossing): Likewise.
* emit-rtl.cc (try_split, emit_copy_of_insn_after): Likewise.
* haifa-sched.cc (sched_create_recovery_edges): Likewise.
* jump.cc (redirect_jump_2): Likewise.
* recog.cc (peep2_attempt): Likewise.
* reorg.cc (fill_slots_from_thread, relax_delay_slots): Likewise.
Signed-off-by: Trevor Saunders <[email protected]>
---
gcc/bb-reorder.cc | 2 +-
gcc/cfgrtl.cc | 4 ++--
gcc/emit-rtl.cc | 4 ++--
gcc/haifa-sched.cc | 2 +-
gcc/jump.cc | 2 +-
gcc/recog.cc | 2 +-
gcc/reorg.cc | 6 +++---
gcc/rtl.h | 15 ++++++++++++---
8 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/gcc/bb-reorder.cc b/gcc/bb-reorder.cc
index 81a1e0f9ddd..6aac52b0661 100644
--- a/gcc/bb-reorder.cc
+++ b/gcc/bb-reorder.cc
@@ -2334,7 +2334,7 @@ update_crossing_jump_flags (void)
if (e->flags & EDGE_CROSSING)
{
if (JUMP_P (BB_END (bb)))
- CROSSING_JUMP_P (BB_END (bb)) = 1;
+ set_crossing_jump (BB_END (bb), true);
break;
}
}
diff --git a/gcc/cfgrtl.cc b/gcc/cfgrtl.cc
index c7c76967c3e..cf265755ece 100644
--- a/gcc/cfgrtl.cc
+++ b/gcc/cfgrtl.cc
@@ -1498,7 +1498,7 @@ fixup_partition_crossing (edge e)
{
e->flags |= EDGE_CROSSING;
if (JUMP_P (BB_END (e->src)))
- CROSSING_JUMP_P (BB_END (e->src)) = 1;
+ set_crossing_jump (BB_END (e->src), true);
}
else if (BB_PARTITION (e->src) == BB_PARTITION (e->dest))
{
@@ -1518,7 +1518,7 @@ fixup_partition_crossing (edge e)
break;
}
if (!has_crossing_succ)
- CROSSING_JUMP_P (BB_END (e->src)) = 0;
+ set_crossing_jump (BB_END (e->src), false);
}
}
}
diff --git a/gcc/emit-rtl.cc b/gcc/emit-rtl.cc
index 763225b57e9..46cc60e66c9 100644
--- a/gcc/emit-rtl.cc
+++ b/gcc/emit-rtl.cc
@@ -4051,7 +4051,7 @@ try_split (rtx pat, rtx_insn *trial, int last)
if (JUMP_P (insn))
{
if (JUMP_P (trial))
- CROSSING_JUMP_P (insn) = CROSSING_JUMP_P (trial);
+ set_crossing_jump (insn, CROSSING_JUMP_P (trial));
mark_jump_label (PATTERN (insn), insn, 0);
njumps++;
if (probability.initialized_p ()
@@ -6664,7 +6664,7 @@ emit_copy_of_insn_after (rtx_insn *insn, rtx_insn *after)
case JUMP_INSN:
new_rtx = emit_jump_insn_after (copy_insn (PATTERN (insn)), after);
- CROSSING_JUMP_P (new_rtx) = CROSSING_JUMP_P (insn);
+ set_crossing_jump (new_rtx, CROSSING_JUMP_P (insn));
break;
case DEBUG_INSN:
diff --git a/gcc/haifa-sched.cc b/gcc/haifa-sched.cc
index 1382713121a..24054eed361 100644
--- a/gcc/haifa-sched.cc
+++ b/gcc/haifa-sched.cc
@@ -8330,7 +8330,7 @@ sched_create_recovery_edges (basic_block first_bb,
basic_block rec,
{
/* We don't need the same note for the check because
any_condjump_p (check) == true. */
- CROSSING_JUMP_P (jump) = 1;
+ set_crossing_jump (jump, true);
}
edge_flags = EDGE_CROSSING;
}
diff --git a/gcc/jump.cc b/gcc/jump.cc
index 545f1cb85f7..0f8776e3552 100644
--- a/gcc/jump.cc
+++ b/gcc/jump.cc
@@ -1552,7 +1552,7 @@ redirect_jump_2 (rtx_jump_insn *jump, rtx olabel, rtx
nlabel, int delete_unused,
label and are now changing it into a direct conditional return.
The jump is no longer crossing in that case. */
if (ANY_RETURN_P (nlabel))
- CROSSING_JUMP_P (jump) = 0;
+ set_crossing_jump (jump, false);
if (!ANY_RETURN_P (olabel)
&& --LABEL_NUSES (olabel) == 0 && delete_unused > 0
diff --git a/gcc/recog.cc b/gcc/recog.cc
index 388aeeac8ae..188ebc37834 100644
--- a/gcc/recog.cc
+++ b/gcc/recog.cc
@@ -4177,7 +4177,7 @@ peep2_attempt (basic_block bb, rtx_insn *insn, int
match_len, rtx_insn *attempt)
peep2_insn_data[i].insn,
INSN_LOCATION (peepinsn));
if (JUMP_P (peepinsn) && JUMP_P (last))
- CROSSING_JUMP_P (last) = CROSSING_JUMP_P (peepinsn);
+ set_crossing_jump (last, CROSSING_JUMP_P (peepinsn));
before_try = PREV_INSN (insn);
delete_insn_chain (insn, peep2_insn_data[i].insn, false);
diff --git a/gcc/reorg.cc b/gcc/reorg.cc
index d9d2fe46a3d..a0db455e0c4 100644
--- a/gcc/reorg.cc
+++ b/gcc/reorg.cc
@@ -2747,7 +2747,7 @@ fill_slots_from_thread (rtx_jump_insn *insn, rtx
condition,
{
reorg_redirect_jump (insn, label);
if (crossing)
- CROSSING_JUMP_P (insn) = 1;
+ set_crossing_jump (insn, true);
}
}
}
@@ -3125,7 +3125,7 @@ relax_delay_slots (rtx_insn *first)
{
reorg_redirect_jump (jump_insn, target_label);
if (crossing)
- CROSSING_JUMP_P (jump_insn) = 1;
+ set_crossing_jump (jump_insn, true);
}
/* See if this jump conditionally branches around an unconditional
@@ -3282,7 +3282,7 @@ relax_delay_slots (rtx_insn *first)
reorg_redirect_jump (delay_jump_insn, trial);
target_label = trial;
if (crossing)
- CROSSING_JUMP_P (delay_jump_insn) = 1;
+ set_crossing_jump (delay_jump_insn, true);
}
/* If the first insn at TARGET_LABEL is redundant with a previous
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 405232b5bd5..b94f1e9f906 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1583,9 +1583,18 @@ jump_table_for_label (const rtx_code_label *label)
(RTL_FLAG_CHECK6 ("RTX_FRAME_RELATED_P", (RTX), DEBUG_INSN, INSN, \
CALL_INSN, JUMP_INSN, BARRIER, SET)->frame_related)
-/* 1 if JUMP RTX is a crossing jump. */
-#define CROSSING_JUMP_P(RTX) \
- (RTL_FLAG_CHECK1 ("CROSSING_JUMP_P", (RTX), JUMP_INSN)->jump)
+/* If JUMP RTX is a crossing jump. */
+inline bool
+CROSSING_JUMP_P (const rtx_insn *insn)
+{
+ return RTL_FLAG_CHECK1 ("CROSSING_JUMP_P", insn, JUMP_INSN)->jump;
+}
+
+inline void
+set_crossing_jump (rtx_insn *insn, bool set)
+{
+ RTL_FLAG_CHECK1 ("CROSSING_JUMP_P", insn, JUMP_INSN)->jump = set;
+}
/* 1 if RTX is a call to a const function. Built from ECF_CONST and
TREE_READONLY. */
--
2.53.0