summaryrefslogtreecommitdiff
path: root/gcc/reorg.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-07 05:49:18 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-09-07 05:49:18 +0000
commit7014838cdd847f5d22f8b4bff0285ad622b707b5 (patch)
treef1a67b6ea75a7f0da3f06e0a1c60b213f4403168 /gcc/reorg.c
parent713829e97b2cabe9369424002f6efb23a7c86aba (diff)
downloadgcc-7014838cdd847f5d22f8b4bff0285ad622b707b5.tar.gz
Merge in gcc2-ss-010999
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29150 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reorg.c')
-rw-r--r--gcc/reorg.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 2db04a169b2..43330619603 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -717,7 +717,8 @@ optimize_skip (insn)
we have one insn followed by a branch to the same label we branch to.
In both of these cases, inverting the jump and annulling the delay
slot give the same effect in fewer insns. */
- if ((next_trial == next_active_insn (JUMP_LABEL (insn)))
+ if ((next_trial == next_active_insn (JUMP_LABEL (insn))
+ && ! (next_trial == 0 && current_function_epilogue_delay_list != 0))
|| (next_trial != 0
&& GET_CODE (next_trial) == JUMP_INSN
&& JUMP_LABEL (insn) == JUMP_LABEL (next_trial)
@@ -2021,10 +2022,10 @@ fill_simple_delay_slots (non_jumps_p)
|| (GET_CODE (insn) != JUMP_INSN && ! non_jumps_p))
continue;
- if (GET_CODE (insn) == JUMP_INSN)
- flags = get_jump_flags (insn, JUMP_LABEL (insn));
- else
- flags = get_jump_flags (insn, NULL_RTX);
+ /* It may have been that this insn used to need delay slots, but
+ now doesn't; ignore in that case. This can happen, for example,
+ on the HP PA RISC, where the number of delay slots depends on
+ what insns are nearby. */
slots_to_fill = num_delay_slots (insn);
/* Some machine description have defined instructions to have
@@ -2062,6 +2063,11 @@ fill_simple_delay_slots (non_jumps_p)
slots_filled = 0;
delay_list = 0;
+ if (GET_CODE (insn) == JUMP_INSN)
+ flags = get_jump_flags (insn, JUMP_LABEL (insn));
+ else
+ flags = get_jump_flags (insn, NULL_RTX);
+
if ((trial = next_active_insn (insn))
&& GET_CODE (trial) == JUMP_INSN
&& simplejump_p (trial)
@@ -2134,8 +2140,7 @@ fill_simple_delay_slots (non_jumps_p)
&& ! insn_sets_resource_p (trial, &needed, 1)
#ifdef HAVE_cc0
/* Can't separate set of cc0 from its use. */
- && ! (reg_mentioned_p (cc0_rtx, pat)
- && ! sets_cc0_p (pat))
+ && ! (reg_mentioned_p (cc0_rtx, pat) && ! sets_cc0_p (pat))
#endif
)
{
@@ -2925,7 +2930,7 @@ fill_eager_delay_slots ()
allows the port to favor filling the delay slot of the call with
the unconditional jump. */
if (slots_to_fill == 0)
- continue;
+ continue;
slots_filled = 0;
target_label = JUMP_LABEL (insn);