aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClinton Popetz <cpopetz@cygnus.com>2000-03-06 21:17:44 +0000
committerClinton Popetz <cpopetz@gcc.gnu.org>2000-03-06 16:17:44 -0500
commitb1b41fe4acbba6e729d035d3d561e0f82ff5f06a (patch)
tree85c46414bfb11dcd32ce6e4dfb1d45a66a43d8be
parent162193477282b2ffe340203613cae8db64a500a6 (diff)
downloadgcc-b1b41fe4acbba6e729d035d3d561e0f82ff5f06a.zip
gcc-b1b41fe4acbba6e729d035d3d561e0f82ff5f06a.tar.gz
gcc-b1b41fe4acbba6e729d035d3d561e0f82ff5f06a.tar.bz2
sh.c: (barrier_align): Handle a delay slot that is filled with an insn from the jump...
* config/sh/sh.c: (barrier_align): Handle a delay slot that is filled with an insn from the jump target. From-SVN: r32371
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/sh/sh.c23
2 files changed, 25 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fb42c09..3c8feb5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2000-03-06 Clinton Popetz <cpopetz@cygnus.com>
+
+ * config/sh/sh.c: (barrier_align): Handle a delay slot that is
+ filled with an insn from the jump target.
+
2000-03-07 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* config/c4x/c4x-protos.h (c4x_global_name): Constify char *.
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 0c3d6f1..28d199c 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -2711,7 +2711,7 @@ barrier_align (barrier_or_label)
rtx barrier_or_label;
{
rtx next = next_real_insn (barrier_or_label), pat, prev;
- int slot, credit;
+ int slot, credit, jump_to_next;
if (! next)
return 0;
@@ -2754,6 +2754,13 @@ barrier_align (barrier_or_label)
an alignment, against that of fetching unneeded insn in front of the
branch target when there is no alignment. */
+ /* There are two delay_slot cases to consider. One is the simple case
+ where the preceding branch is to the insn beyond the barrier (simple
+ delay slot filling), and the other is where the preceding branch has
+ a delay slot that is a duplicate of the insn after the barrier
+ (fill_eager_delay_slots) and the branch is to the insn after the insn
+ after the barrier. */
+
/* PREV is presumed to be the JUMP_INSN for the barrier under
investigation. Skip to the insn before it. */
prev = prev_real_insn (prev);
@@ -2762,11 +2769,21 @@ barrier_align (barrier_or_label)
credit >= 0 && prev && GET_CODE (prev) == INSN;
prev = prev_real_insn (prev))
{
+ jump_to_next = 0;
if (GET_CODE (PATTERN (prev)) == USE
|| GET_CODE (PATTERN (prev)) == CLOBBER)
continue;
if (GET_CODE (PATTERN (prev)) == SEQUENCE)
- prev = XVECEXP (PATTERN (prev), 0, 1);
+ {
+ prev = XVECEXP (PATTERN (prev), 0, 1);
+ if (INSN_UID (prev) == INSN_UID (next))
+ {
+ /* Delay slot was filled with insn at jump target. */
+ jump_to_next = 1;
+ continue;
+ }
+ }
+
if (slot &&
get_attr_in_delay_slot (prev) == IN_DELAY_SLOT_YES)
slot = 0;
@@ -2775,7 +2792,7 @@ barrier_align (barrier_or_label)
if (prev
&& GET_CODE (prev) == JUMP_INSN
&& JUMP_LABEL (prev)
- && next_real_insn (JUMP_LABEL (prev)) == next_real_insn (barrier_or_label))
+ && (jump_to_next || next_real_insn (JUMP_LABEL (prev)) == next))
{
rtx pat = PATTERN (prev);
if (GET_CODE (pat) == PARALLEL)