summaryrefslogtreecommitdiff
path: root/gcc/reorg.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-09-15 21:39:39 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-09-15 21:39:39 +0000
commite6836d7e9a181e2f792f06aaff6257012e51170d (patch)
treed66f938288685189b7e94879004a1eafcf73fe6d /gcc/reorg.c
parent601520ecb1ecb6631c61e8f23d189b7a136559f1 (diff)
downloadgcc-e6836d7e9a181e2f792f06aaff6257012e51170d.tar.gz
(fill_simple_delay_slots): When filling an insn's delay slot with a
JUMP_INSN, don't assume the JUMP_INSN immediately follows the insn on the unfilled slots obstack. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@10362 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reorg.c')
-rw-r--r--gcc/reorg.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 00e860ce087..edd76d5d21b 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -2857,12 +2857,24 @@ fill_simple_delay_slots (first, non_jumps_p)
&& eligible_for_delay (insn, slots_filled, trial, flags)
&& no_labels_between_p (insn, trial))
{
+ rtx *tmp;
slots_filled++;
delay_list = add_to_delay_list (trial, delay_list);
+
+ /* TRIAL may have had its delay slot filled, then unfilled. When
+ the delay slot is unfilled, TRIAL is placed back on the unfilled
+ slots obstack. Unfortunately, it is placed on the end of the
+ obstack, not in its original location. Therefore, we must search
+ from entry i + 1 to the end of the unfilled slots obstack to
+ try and find TRIAL. */
+ tmp = &unfilled_slots_base[i + 1];
+ while (*tmp != trial && tmp != unfilled_slots_next)
+ tmp++;
+
/* Remove the unconditional jump from consideration for delay slot
- filling and unthread it. */
- if (unfilled_slots_base[i + 1] == trial)
- unfilled_slots_base[i + 1] = 0;
+ filling and unthread it. */
+ if (*tmp == trial)
+ *tmp = 0;
{
rtx next = NEXT_INSN (trial);
rtx prev = PREV_INSN (trial);