]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR rtl-optimization/46649 (ICE: in move_bb_info, at sel-sched-ir.c:5080...
authorAndrey Belevantsev <abel@ispras.ru>
Thu, 7 Apr 2011 07:01:25 +0000 (11:01 +0400)
committerAndrey Belevantsev <abel@gcc.gnu.org>
Thu, 7 Apr 2011 07:01:25 +0000 (11:01 +0400)
        Backport from mainline
        2010-12-15  Alexander Monakov  <amonakov@ispras.ru>

        PR rtl-optimization/46649
        * sel-sched-ir.c (purge_empty_blocks): Unconditionally skip the first
        basic block in the region.

From-SVN: r172086

gcc/ChangeLog
gcc/sel-sched-ir.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/pr46649.C [new file with mode: 0644]

index 90f310ae051df292e1b2d471477b53e9e8dfb012..b4b968e36988f1895c7ed37edd25ab367a8bb615 100644 (file)
@@ -1,3 +1,12 @@
+2011-04-07  Andrey Belevantsev  <abel@ispras.ru>
+
+       Backport from mainline
+       2010-12-15  Alexander Monakov  <amonakov@ispras.ru>
+
+       PR rtl-optimization/46649
+       * sel-sched-ir.c (purge_empty_blocks): Unconditionally skip the first
+       basic block in the region.
+
 2011-04-07  Andrey Belevantsev  <abel@ispras.ru>
 
        Backport from mainline
index 4c3d94a73609f4c17c2b868f1823188a40611956..8ec8444d13a853509ae563569c5966c1c8e38685 100644 (file)
@@ -3746,10 +3746,10 @@ tidy_control_flow (basic_block xbb, bool full_tidying)
 void
 purge_empty_blocks (void)
 {
-  /* Do not attempt to delete preheader.  */
-  int i = sel_is_loop_preheader_p (BASIC_BLOCK (BB_TO_BLOCK (0))) ? 1 : 0;
+  int i;
 
-  while (i < current_nr_blocks)
+  /* Do not attempt to delete the first basic block in the region.  */
+  for (i = 1; i < current_nr_blocks; )
     {
       basic_block b = BASIC_BLOCK (BB_TO_BLOCK (i));
 
index ea578fabf13175e24177ef958ac63bc66feaec70..9fb4112e1c6727ea3cda4b410599a14043a53f37 100644 (file)
@@ -1,3 +1,11 @@
+2011-04-07  Andrey Belevantsev  <abel@ispras.ru>
+
+       Backport from mainline
+       2010-12-15  Alexander Monakov  <amonakov@ispras.ru>
+
+       PR rtl-optimization/46649
+       * g++.dg/opt/pr46649.C: New.
+
 2011-04-07  Andrey Belevantsev  <abel@ispras.ru>
 
        Backport from mainline
diff --git a/gcc/testsuite/g++.dg/opt/pr46649.C b/gcc/testsuite/g++.dg/opt/pr46649.C
new file mode 100644 (file)
index 0000000..1428e8b
--- /dev/null
@@ -0,0 +1,9 @@
+// { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } }
+// { dg-options "-fschedule-insns -fselective-scheduling" }
+
+void foo ()
+{
+  for (;;)
+    for (;;({break;}))
+    ;
+}