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

        PR rtl-optimization/47036
        * sel-sched-ir.c (fallthru_bb_of_jump): Remove special support for
        unconditional jumps.
        * sel-sched.c (moveup_expr): Ditto.

From-SVN: r172087

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

index b4b968e36988f1895c7ed37edd25ab367a8bb615..aa1f621ad1a87f9e7e8a6f0576803ad327f94cd9 100644 (file)
@@ -1,3 +1,13 @@
+2011-04-07  Andrey Belevantsev  <abel@ispras.ru>
+
+       Backport from mainline
+       2010-12-24  Alexander Monakov  <amonakov@ispras.ru>
+
+       PR rtl-optimization/47036
+       * sel-sched-ir.c (fallthru_bb_of_jump): Remove special support for
+       unconditional jumps.
+       * sel-sched.c (moveup_expr): Ditto.
+
 2011-04-07  Andrey Belevantsev  <abel@ispras.ru>
 
        Backport from mainline
index 8ec8444d13a853509ae563569c5966c1c8e38685..b6002d10aefd13bb5d3c92b9bb6d05e3801fea41 100644 (file)
@@ -4421,9 +4421,6 @@ fallthru_bb_of_jump (rtx jump)
   if (!JUMP_P (jump))
     return NULL;
 
-  if (any_uncondjump_p (jump))
-    return single_succ (BLOCK_FOR_INSN (jump));
-
   if (!any_condjump_p (jump))
     return NULL;
 
index 91c41d34fd3050a404e62add630be056879c5ddf..bbfbcf0350758e309927fac110e938cb720c8cce 100644 (file)
@@ -2170,10 +2170,8 @@ moveup_expr (expr_t expr, insn_t through_insn, bool inside_insn_group,
               || ! in_current_region_p (fallthru_bb))
             return MOVEUP_EXPR_NULL;
 
-          /* And it should be mutually exclusive with through_insn, or
-             be an unconditional jump.  */
-          if (! any_uncondjump_p (insn)
-              && ! sched_insns_conditions_mutex_p (insn, through_insn)
+          /* And it should be mutually exclusive with through_insn.  */
+          if (! sched_insns_conditions_mutex_p (insn, through_insn)
              && ! DEBUG_INSN_P (through_insn))
             return MOVEUP_EXPR_NULL;
         }
index 9fb4112e1c6727ea3cda4b410599a14043a53f37..b6eab437fa55ee7ff762566573f1c0e0211f8536 100644 (file)
@@ -1,3 +1,11 @@
+2011-04-07  Andrey Belevantsev  <abel@ispras.ru>
+
+       Backport from mainline
+       2010-12-24  Alexander Monakov  <amonakov@ispras.ru>
+
+       PR rtl-optimization/47036
+       * g++.dg/opt/pr47036.C: New.
+
 2011-04-07  Andrey Belevantsev  <abel@ispras.ru>
 
        Backport from mainline
diff --git a/gcc/testsuite/g++.dg/opt/pr47036.C b/gcc/testsuite/g++.dg/opt/pr47036.C
new file mode 100644 (file)
index 0000000..d6d5adc
--- /dev/null
@@ -0,0 +1,10 @@
+// { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } }
+// { dg-options "-fschedule-insns -fselective-scheduling -fno-dce" }
+
+
+void foo ()
+{
+  for (;;)
+    for (;;({break;}));
+}
+