re PR target/48273 (ICE: in create_copy_of_insn_rtx, at sel-sched-ir.c:5604 with -fsel-sched-pipelining -fselective-scheduling2 -march=core2)

PR target/48273
	* cfgloop.h (loop_has_exit_edges): New helper.
	* sel-sched-ir.c (init_global_and_expr_for_insn): Make CALLs
	non-clonable.
	* sel-sched.c (sel_setup_region_sched_flags): Don't pipeline loops
	that have no exit edges.

testsuite:
	* g++.dg/opt/pr48273.C: New.

From-SVN: r172175
This commit is contained in:
Alexander Monakov 2011-04-08 15:49:43 +04:00 committed by Alexander Monakov
parent 1f3b2b4e29
commit 07643d76c7
6 changed files with 35 additions and 1 deletions

View File

@ -1,3 +1,12 @@
2011-04-08 Alexander Monakov <amonakov@ispras.ru>
PR target/48273
* cfgloop.h (loop_has_exit_edges): New helper.
* sel-sched-ir.c (init_global_and_expr_for_insn): Make CALLs
non-clonable.
* sel-sched.c (sel_setup_region_sched_flags): Don't pipeline loops
that have no exit edges.
2011-04-08 Alexander Monakov <amonakov@ispras.ru>
PR rtl-optimization/48442

View File

@ -443,6 +443,14 @@ loop_outer (const struct loop *loop)
return VEC_index (loop_p, loop->superloops, n - 1);
}
/* Returns true if LOOP has at least one exit edge. */
static inline bool
loop_has_exit_edges (const struct loop *loop)
{
return loop->exits->next->e != NULL;
}
/* Returns the list of loops in current_loops. */
static inline VEC (loop_p, gc) *

View File

@ -2905,6 +2905,7 @@ init_global_and_expr_for_insn (insn_t insn)
if (CANT_MOVE (insn)
|| INSN_ASM_P (insn)
|| SCHED_GROUP_P (insn)
|| CALL_P (insn)
/* Exception handling insns are always unique. */
|| (cfun->can_throw_non_call_exceptions && can_throw_internal (insn))
/* TRAP_IF though have an INSN code is control_flow_insn_p (). */

View File

@ -6781,7 +6781,8 @@ sel_setup_region_sched_flags (void)
bookkeeping_p = 1;
pipelining_p = (bookkeeping_p
&& (flag_sel_sched_pipelining != 0)
&& current_loop_nest != NULL);
&& current_loop_nest != NULL
&& loop_has_exit_edges (current_loop_nest));
max_insns_to_rename = PARAM_VALUE (PARAM_SELSCHED_INSNS_TO_RENAME);
max_ws = MAX_WS;
}

View File

@ -1,3 +1,8 @@
2011-04-08 Alexander Monakov <amonakov@ispras.ru>
PR target/48273
* g++.dg/opt/pr48273.C: New.
2011-04-08 Alexander Monakov <amonakov@ispras.ru>
PR rtl-optimization/48442

View File

@ -0,0 +1,10 @@
// { dg-do compile { target x86_64-*-* } }
// { dg-options "-fschedule-insns2 -fsel-sched-pipelining -fselective-scheduling2 -funroll-all-loops -march=core2" }
void bar ();
void foo ()
{
for (;;)
bar ();
}