PR rtl-optimization/45353
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 20 Aug 2010 18:07:12 +0000 (18:07 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 20 Aug 2010 18:07:12 +0000 (18:07 +0000)
* sel-sched-ir.c (sel_bb_head): Return NULL even if next_nonnote_insn
after bb_note is a BARRIER.

* gcc.dg/pr45353.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163412 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/sel-sched-ir.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr45353.c [new file with mode: 0644]

index 3c3af51..68d8c10 100644 (file)
@@ -1,3 +1,9 @@
+2010-08-20  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/45353
+       * sel-sched-ir.c (sel_bb_head): Return NULL even if next_nonnote_insn
+       after bb_note is a BARRIER.
+
 2010-08-20  Iain Sandoe  <iains@gcc.gnu.org>
 
        * config/rs6000/darwin.h (LIB_SPEC): New. Provide save/restFP by 
index f23b7cf..a9d7ccf 100644 (file)
@@ -4326,7 +4326,7 @@ sel_bb_head (basic_block bb)
       note = bb_note (bb);
       head = next_nonnote_insn (note);
 
-      if (head && BLOCK_FOR_INSN (head) != bb)
+      if (head && (BARRIER_P (head) || BLOCK_FOR_INSN (head) != bb))
        head = NULL_RTX;
     }
 
index 7d15024..0c1b613 100644 (file)
@@ -1,3 +1,8 @@
+2010-08-20  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/45353
+       * gcc.dg/pr45353.c: New test.
+
 2010-08-20  Nathan Sidwell  <nathan@codesourcery.com>
 
        * gcc.target/i386/volatile-2.c: New.
diff --git a/gcc/testsuite/gcc.dg/pr45353.c b/gcc/testsuite/gcc.dg/pr45353.c
new file mode 100644 (file)
index 0000000..e3277a8
--- /dev/null
@@ -0,0 +1,9 @@
+/* PR rtl-optimization/45353 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fschedule-insns -fselective-scheduling" } */
+
+void
+foo ()
+{
+  __builtin_unreachable ();
+}