http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56950

--- Comment #5 from Steven Bosscher <steven at gcc dot gnu.org> ---
This patch makes the ICE go away, but it doesn't really solve the bug.

The scheduler inserts (in this case) notes between basic blocks in the
sched1 pass, which runs in cfglayout mode.  But "between basic blocks"
in cfglayout mode means nothing: such things belong in BB_HEADER and
BB_FOOTER.

But that happens before and after this patch, so the patch merely puts
things back to the status ante quo.  So be solved properly later...

Index: haifa-sched.c
===================================================================
--- haifa-sched.c       (revision 199028)
+++ haifa-sched.c       (working copy)
@@ -7442,11 +7442,12 @@ sched_extend_bb (void)
   if (NEXT_INSN (insn) == 0
       || (!NOTE_P (insn)
          && !LABEL_P (insn)
+         && !DEBUG_INSN_P (insn)
          /* Don't emit a NOTE if it would end up before a BARRIER.  */
          && !BARRIER_P (NEXT_INSN (insn))))
     {
       rtx note = emit_note_after (NOTE_INSN_DELETED, insn);
-      /* Make insn appear outside BB.  */
+      /* Make note appear outside BB.  */
       set_block_for_insn (note, NULL);
       BB_END (EXIT_BLOCK_PTR->prev_bb) = insn;
     }

Reply via email to