re PR tree-optimization/81374 (ICE in bb_top_order_cmp, at tree-loop-distribution.c:391)

PR tree-optimization/81374
	* tree-loop-distribution.c (pass_loop_distribution::execute): Record
	the max index of basic blocks, rather than number of basic blocks.

From-SVN: r250268
This commit is contained in:
Bin Cheng 2017-07-17 11:34:30 +00:00 committed by Bin Cheng
parent b6c354ebc7
commit 3fb824520b
2 changed files with 10 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2017-07-17 Bin Cheng <bin.cheng@arm.com>
PR tree-optimization/81374
* tree-loop-distribution.c (pass_loop_distribution::execute): Record
the max index of basic blocks, rather than number of basic blocks.
2017-07-17 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc-protos.h (arc_legitimate_pc_offset_p): Remove

View file

@ -2614,12 +2614,13 @@ pass_loop_distribution::execute (function *fun)
lexicographical order. */
if (bb_top_order_index == NULL)
{
int rpo_num;
int *rpo = XNEWVEC (int, last_basic_block_for_fn (cfun));
bb_top_order_index = XNEWVEC (int, last_basic_block_for_fn (cfun));
bb_top_order_index_size
= pre_and_rev_post_order_compute_fn (cfun, NULL, rpo, true);
for (int i = 0; i < bb_top_order_index_size; i++)
bb_top_order_index_size = last_basic_block_for_fn (cfun);
rpo_num = pre_and_rev_post_order_compute_fn (cfun, NULL, rpo, true);
for (int i = 0; i < rpo_num; i++)
bb_top_order_index[rpo[i]] = i;
free (rpo);