From b73edd22fdbdef327dff73be8ba6c107cac135bd Mon Sep 17 00:00:00 2001 From: amonakov Date: Fri, 8 Apr 2011 11:53:25 +0000 Subject: PR rtl-optimization/48302 * sel-sched-ir.h (sel_add_loop_preheaders): Update prototype. * sel-sched-ir.c (sel_add_loop_preheaders): Add 'bbs' argument. Use it to record added preheader blocks. * sel-sched.c (setup_current_loop_nest): Add 'bbs' argument. Pass it on to sel_add_loop_preheaders. (sel_region_init): Move call to setup_current_loop_nest after sel_init_bbs. testsuite: * g++.dg/opt/pr48302.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172176 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/sel-sched.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gcc/sel-sched.c') diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index fb1a026bf28..48fb2e0134d 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -6801,7 +6801,7 @@ current_region_empty_p (void) /* Prepare and verify loop nest for pipelining. */ static void -setup_current_loop_nest (int rgn) +setup_current_loop_nest (int rgn, bb_vec_t *bbs) { current_loop_nest = get_loop_nest_for_rgn (rgn); @@ -6810,7 +6810,7 @@ setup_current_loop_nest (int rgn) /* If this loop has any saved loop preheaders from nested loops, add these basic blocks to the current region. */ - sel_add_loop_preheaders (); + sel_add_loop_preheaders (bbs); /* Check that we're starting with a valid information. */ gcc_assert (loop_latch_edge (current_loop_nest)); @@ -6849,9 +6849,6 @@ sel_region_init (int rgn) if (current_region_empty_p ()) return true; - if (flag_sel_sched_pipelining) - setup_current_loop_nest (rgn); - sel_setup_region_sched_flags (); bbs = VEC_alloc (basic_block, heap, current_nr_blocks); @@ -6861,6 +6858,9 @@ sel_region_init (int rgn) sel_init_bbs (bbs, NULL); + if (flag_sel_sched_pipelining) + setup_current_loop_nest (rgn, &bbs); + /* Initialize luids and dependence analysis which both sel-sched and haifa need. */ sched_init_luids (bbs, NULL, NULL, NULL); -- cgit v1.2.1