From 5c49e6ea02664b6f2c8167e310e571e3eabdab41 Mon Sep 17 00:00:00 2001 From: amker Date: Mon, 17 Jul 2017 11:34:30 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250268 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/tree-loop-distribution.c | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 95c64c6e638..841f22616f1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-07-17 Bin Cheng + + 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 * config/arc/arc-protos.h (arc_legitimate_pc_offset_p): Remove diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index be0a6603ed2..5c8f29dc36f 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -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); -- 2.11.4.GIT