On 04/07/2011 01:30 PM, Alexander Monakov wrote:
Hi,
Selective scheduler does not explicitly forbid creating bookkeeping copies of
CALLs, but an assert in create_copy_of_insn_rtx does not expect a CALL. Since
there's little benefit from aggressive scheduling of CALLs, it makes sense to
restrict it so that CALLs cannot be duplicated.
This patch makes CALLs non-clonable by adding an explicit check in additional
to other non-clonable insns (ASMs, instructions that are a part of
SCHED_GROUPs, etc.). We also need to forbid pipelining of loops that have no
exit edges, since our check for whether a motion would create bookkeeping does
not work in that case (it's one of the solutions; the other is to fixup
remove_insns_that_need_bookkeeping function, but this one is simpler and
faster).
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_setup_region_sched_flags): Don't pipeline loops that have no
exit edges.
testsuite:
* g++.dg/opt/pr48273.C: New.
Ok, thanks.