From: Andrey Belevantsev Date: Thu, 7 Apr 2011 07:02:34 +0000 (+0400) Subject: backport: re PR rtl-optimization/47036 (ICE: in move_cond_jump, at sel-sched.c:4901... X-Git-Tag: releases/gcc-4.5.3~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=096bc0e25b58a4465702ae39af01b5ac6d36c120;p=thirdparty%2Fgcc.git backport: re PR rtl-optimization/47036 (ICE: in move_cond_jump, at sel-sched.c:4901 with -fschedule-insns -fselective-scheduling -fno-dce) Backport from mainline 2010-12-24 Alexander Monakov 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b4b968e36988..aa1f621ad1a8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2011-04-07 Andrey Belevantsev + + Backport from mainline + 2010-12-24 Alexander Monakov + + 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 Backport from mainline diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c index 8ec8444d13a8..b6002d10aefd 100644 --- a/gcc/sel-sched-ir.c +++ b/gcc/sel-sched-ir.c @@ -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; diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index 91c41d34fd30..bbfbcf035075 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9fb4112e1c67..b6eab437fa55 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2011-04-07 Andrey Belevantsev + + Backport from mainline + 2010-12-24 Alexander Monakov + + PR rtl-optimization/47036 + * g++.dg/opt/pr47036.C: New. + 2011-04-07 Andrey Belevantsev 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 index 000000000000..d6d5adc6a48a --- /dev/null +++ b/gcc/testsuite/g++.dg/opt/pr47036.C @@ -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;})); +} +