From afd14b632516314fcc5392f234755b0d4010451e Mon Sep 17 00:00:00 2001 From: amonakov Date: Fri, 24 Dec 2010 14:19:23 +0000 Subject: [PATCH] PR rtl-optimization/47036 * sel-sched-ir.c (fallthru_bb_of_jump): Remove special support for unconditional jumps. * sel-sched.c (moveup_expr): Ditto. testsuite: * g++.dg/opt/pr47036.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168225 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 7 +++++++ gcc/sel-sched-ir.c | 3 --- gcc/sel-sched.c | 6 ++---- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/opt/pr47036.C | 10 ++++++++++ 5 files changed, 24 insertions(+), 7 deletions(-) create mode 100644 gcc/testsuite/g++.dg/opt/pr47036.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 83ad1a9c382..26762f28d49 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +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. + 2010-12-23 Sebastian Pop Richard Guenther diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c index 43619d9dac4..b88dad1b3f6 100644 --- a/gcc/sel-sched-ir.c +++ b/gcc/sel-sched-ir.c @@ -4441,9 +4441,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 edd6cb9d3cd..791adf1f6a8 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -2171,10 +2171,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 bd527d7a4a3..2cc045ba7e2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-12-24 Alexander Monakov + + PR rtl-optimization/47036 + * g++.dg/opt/pr47036.C: New. + 2010-12-24 Thomas Koenig PR fortran/31821 diff --git a/gcc/testsuite/g++.dg/opt/pr47036.C b/gcc/testsuite/g++.dg/opt/pr47036.C new file mode 100644 index 00000000000..d6d5adc6a48 --- /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;})); +} + -- 2.11.0