reorg.c (optimize_skip): Do not put frame related instructions in annulled delay...
authorSteve Ellcey <sellcey@imgtec.com>
Mon, 7 Dec 2015 20:37:38 +0000 (20:37 +0000)
committerSteve Ellcey <sje@gcc.gnu.org>
Mon, 7 Dec 2015 20:37:38 +0000 (20:37 +0000)
2015-12-07  Steve Ellcey  <sellcey@imgtec.com>

* reorg.c (optimize_skip): Do not put frame related instructions
in annulled delay slots.
(steal_delay_list_from_target): Ditto.
(fill_slots_from_thread): Ditto.

From-SVN: r231382

gcc/ChangeLog
gcc/reorg.c

index 8741e03e458daaf27438d96ea9ccf8918eb555a1..ade56278e4bcd0ae8bfc42d14896c16f058f1ff9 100644 (file)
@@ -1,3 +1,10 @@
+2015-12-07  Steve Ellcey  <sellcey@imgtec.com>
+
+       * reorg.c (optimize_skip): Do not put frame related instructions
+       in annulled delay slots.
+       (steal_delay_list_from_target): Ditto.
+       (fill_slots_from_thread): Ditto.
+
 2015-12-07  Evandro Menezes  <e.menezes@samsung.com>
 
        * config/aarch64/aarch64-cores.def: Use the Exynos M1 sched model.
index cc68d6bc5402df2a9ef9785f1b8a206d66e2f2b9..1930a5f96cd69b823982aba605d65b62b6a44746 100644 (file)
@@ -739,6 +739,7 @@ optimize_skip (rtx_jump_insn *insn, vec<rtx_insn *> *delay_list)
       || recog_memoized (trial) < 0
       || (! eligible_for_annul_false (insn, 0, trial, flags)
          && ! eligible_for_annul_true (insn, 0, trial, flags))
+      || RTX_FRAME_RELATED_P (trial)
       || can_throw_internal (trial))
     return;
 
@@ -1126,7 +1127,13 @@ steal_delay_list_from_target (rtx_insn *insn, rtx condition, rtx_sequence *seq,
                                              trial, flags)))
        {
          if (must_annul)
-           used_annul = 1;
+           {
+             /* Frame related instructions cannot go into annulled delay
+                slots, it messes up the dwarf info.  */
+             if (RTX_FRAME_RELATED_P (trial))
+               return;
+             used_annul = 1;
+           }
          rtx_insn *temp = copy_delay_slot_insn (trial);
          INSN_FROM_TARGET_P (temp) = 1;
          add_to_delay_list (temp, &new_delay_list);
@@ -2464,9 +2471,9 @@ fill_slots_from_thread (rtx_jump_insn *insn, rtx condition,
              if (eligible_for_delay (insn, *pslots_filled, trial, flags))
                goto winner;
            }
-         else if (0
-                  || (ANNUL_IFTRUE_SLOTS && ! thread_if_true)
-                  || (ANNUL_IFFALSE_SLOTS && thread_if_true))
+         else if (!RTX_FRAME_RELATED_P (trial)
+                  && ((ANNUL_IFTRUE_SLOTS && ! thread_if_true)
+                       || (ANNUL_IFFALSE_SLOTS && thread_if_true)))
            {
              old_trial = trial;
              trial = try_split (pat, trial, 0);