re PR debug/56950 (compare-debug failure for gcc.dg/pr41345.c with fschedule-insns)
authorSteven Bosscher <steven@gcc.gnu.org>
Fri, 24 May 2013 20:59:59 +0000 (20:59 +0000)
committerSteven Bosscher <steven@gcc.gnu.org>
Fri, 24 May 2013 20:59:59 +0000 (20:59 +0000)
PR debug/56950
* haifa-sched.c (sched_extend_bb): Ignore DEBUG_INSNs.

From-SVN: r199316

gcc/ChangeLog
gcc/haifa-sched.c

index 1ef26d9ddc1a1ec79999d8120b3484adcb4cdf2d..c910f93e85e6f5e1d522b2267285eb62778f9e80 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-24  Steven Bosscher  <steven@gcc.gnu.org>
+
+       PR debug/56950
+       * haifa-sched.c (sched_extend_bb): Ignore DEBUG_INSNs.
+
 2013-05-24  Nathan Sidwell  <nathan@codesourcery.com>
            Sandra Loosemore  <sandra@codesourcery.com>
 
index 15ddedbe113c2c0763f8d3a4236c16b96505ff46..61eaaefa41863428623f0744ee7207f51232c914 100644 (file)
@@ -7435,20 +7435,19 @@ find_fallthru_edge_from (basic_block pred)
 static void
 sched_extend_bb (void)
 {
-  rtx insn;
-
   /* The following is done to keep current_sched_info->next_tail non null.  */
-  insn = BB_END (EXIT_BLOCK_PTR->prev_bb);
-  if (NEXT_INSN (insn) == 0
+  rtx end = BB_END (EXIT_BLOCK_PTR->prev_bb);
+  rtx insn = DEBUG_INSN_P (end) ? prev_nondebug_insn (end) : end;
+  if (NEXT_INSN (end) == 0
       || (!NOTE_P (insn)
          && !LABEL_P (insn)
          /* Don't emit a NOTE if it would end up before a BARRIER.  */
-         && !BARRIER_P (NEXT_INSN (insn))))
+         && !BARRIER_P (NEXT_INSN (end))))
     {
-      rtx note = emit_note_after (NOTE_INSN_DELETED, insn);
-      /* Make insn appear outside BB.  */
+      rtx note = emit_note_after (NOTE_INSN_DELETED, end);
+      /* Make note appear outside BB.  */
       set_block_for_insn (note, NULL);
-      BB_END (EXIT_BLOCK_PTR->prev_bb) = insn;
+      BB_END (EXIT_BLOCK_PTR->prev_bb) = end;
     }
 }