diff options
author | Andrey Belevantsev <abel@ispras.ru> | 2010-12-22 10:46:53 +0300 |
---|---|---|
committer | Andrey Belevantsev <abel@gcc.gnu.org> | 2010-12-22 10:46:53 +0300 |
commit | d7f672ecf699179114a34020f045d52b9f1d2461 (patch) | |
tree | 82073ce3ad5d93cd8db010086551d856ac634f10 /gcc/sel-sched.c | |
parent | d7ab2512cd9b4330fb12d86d49219782375e3ac4 (diff) | |
download | gcc-d7f672ecf699179114a34020f045d52b9f1d2461.zip gcc-d7f672ecf699179114a34020f045d52b9f1d2461.tar.gz gcc-d7f672ecf699179114a34020f045d52b9f1d2461.tar.bz2 |
re PR rtl-optimization/45352 (ICE: in reset_sched_cycles_in_current_ebb, at sel-sched.c:7058)
PR rtl-optimization/45352
PR rtl-optimization/46521
PR rtl-optimization/46522
* sel-sched.c (reset_sched_cycles_in_current_ebb): Recheck the DFA state
on the last iteration of the advancing loop.
(sel_sched_region_1): Propagate the rescheduling bit to the next block
also for empty blocks.
* gcc.dg/pr46521.c: New.
* gcc.dg/pr46522.c: New.
From-SVN: r168164
Diffstat (limited to 'gcc/sel-sched.c')
-rw-r--r-- | gcc/sel-sched.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index 3b5603c..edd6cb9 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -7053,7 +7053,17 @@ reset_sched_cycles_in_current_ebb (void) && haifa_cost > 0 && estimate_insn_cost (insn, curr_state) == 0) break; - } + + /* When the data dependency stall is longer than the DFA stall, + it could be that after the longer stall the insn will again + become unavailable to the DFA restrictions. Looks strange + but happens e.g. on x86-64. So recheck DFA on the last + iteration. */ + if (after_stall + && real_insn + && haifa_cost == 0) + haifa_cost = estimate_insn_cost (insn, curr_state); + } haifa_clock += i; if (sched_verbose >= 2) @@ -7504,21 +7514,23 @@ sel_sched_region_1 (void) { basic_block bb = EBB_FIRST_BB (i); - if (sel_bb_empty_p (bb)) - { - bitmap_clear_bit (blocks_to_reschedule, bb->index); - continue; - } - if (bitmap_bit_p (blocks_to_reschedule, bb->index)) { + if (! bb_ends_ebb_p (bb)) + bitmap_set_bit (blocks_to_reschedule, bb_next_bb (bb)->index); + if (sel_bb_empty_p (bb)) + { + bitmap_clear_bit (blocks_to_reschedule, bb->index); + continue; + } clear_outdated_rtx_info (bb); if (sel_insn_is_speculation_check (BB_END (bb)) && JUMP_P (BB_END (bb))) bitmap_set_bit (blocks_to_reschedule, BRANCH_EDGE (bb)->dest->index); } - else if (INSN_SCHED_TIMES (sel_bb_head (bb)) <= 0) + else if (! sel_bb_empty_p (bb) + && INSN_SCHED_TIMES (sel_bb_head (bb)) <= 0) bitmap_set_bit (blocks_to_reschedule, bb->index); } |