OSDN Git Service

(fill_simple_delay_slots): When filling an insn's delay slot with a
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 Sep 1995 21:39:39 +0000 (21:39 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 15 Sep 1995 21:39:39 +0000 (21:39 +0000)
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

gcc/reorg.c

index 00e860c..edd76d5 100644 (file)
@@ -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);