aboutsummaryrefslogtreecommitdiff
path: root/gcc/reorg.c
diff options
context:
space:
mode:
authorJohn David Anglin <dave.anglin@nrc-cnrc.gc.ca>2004-05-20 18:36:50 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2004-05-20 18:36:50 +0000
commit52fe4de8a3f1afcefdad091977f9b1a21b92a5a1 (patch)
treecacf03b0026cae4961695314d60373036916041c /gcc/reorg.c
parent7e14028056eafe6486281fb96d17d2f873f6248f (diff)
downloadgcc-52fe4de8a3f1afcefdad091977f9b1a21b92a5a1.zip
gcc-52fe4de8a3f1afcefdad091977f9b1a21b92a5a1.tar.gz
gcc-52fe4de8a3f1afcefdad091977f9b1a21b92a5a1.tar.bz2
reorg.c (delete_from_delay_slot): If we have a barrier after the sequence containing the insn to be deleted...
* reorg.c (delete_from_delay_slot): If we have a barrier after the sequence containing the insn to be deleted, always reemit it. From-SVN: r82065
Diffstat (limited to 'gcc/reorg.c')
-rw-r--r--gcc/reorg.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 2ae0a8f..dd9737b 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -570,6 +570,7 @@ delete_from_delay_slot (rtx insn)
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
@@ -583,6 +584,9 @@ delete_from_delay_slot (rtx insn)
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)
@@ -597,8 +601,8 @@ delete_from_delay_slot (rtx insn)
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