+2004-05-20 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * reorg.c (delete_from_delay_slot): If we have a barrier after the
+ sequence containing the insn to be deleted, always reemit it.
+
2004-05-20 Richard Henderson <rth@redhat.com>
PR 15454
rtx trial, seq_insn, seq, prev;
rtx delay_list = 0;
int i;
+ int had_barrier = 0;
/* We first must find the insn containing the SEQUENCE with INSN in its
delay slot. Do this by finding an insn, TRIAL, where
seq_insn = PREV_INSN (NEXT_INSN (trial));
seq = PATTERN (seq_insn);
+ if (NEXT_INSN (seq_insn) && GET_CODE (NEXT_INSN (seq_insn)) == BARRIER)
+ had_barrier = 1;
+
/* Create a delay list consisting of all the insns other than the one
we are deleting (unless we were the only one). */
if (XVECLEN (seq, 0) > 2)
delete_related_insns (seq_insn);
add_insn_after (trial, prev);
- if (GET_CODE (trial) == JUMP_INSN
- && (simplejump_p (trial) || GET_CODE (PATTERN (trial)) == RETURN))
+ /* If there was a barrier after the old SEQUENCE, remit it. */
+ if (had_barrier)
emit_barrier_after (trial);
/* If there are any delay insns, remit them. Otherwise clear the