From a85234d1efc4ca822934b9fc295069bb8fe7b084 Mon Sep 17 00:00:00 2001 From: danglin Date: Thu, 20 May 2004 18:36:50 +0000 Subject: [PATCH] * reorg.c (delete_from_delay_slot): If we have a barrier after the sequence containing the insn to be deleted, always reemit it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82065 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/reorg.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8d00704e86f..e2f34259861 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-05-20 John David Anglin + + * 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 PR 15454 diff --git a/gcc/reorg.c b/gcc/reorg.c index 2ae0a8f2259..dd9737b506f 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 -- 2.11.0