aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBin Cheng <bin.cheng@arm.com>2017-07-17 11:34:30 +0000
committerBin Cheng <amker@gcc.gnu.org>2017-07-17 11:34:30 +0000
commit3fb824520b804305f510a9a2b84b652a23a72f22 (patch)
tree602cd64be95daacabb08438610d6f6c872196d64 /gcc
parentb6c354ebc736de36d39b2b81e7dd2e3932b28404 (diff)
downloadgcc-3fb824520b804305f510a9a2b84b652a23a72f22.zip
gcc-3fb824520b804305f510a9a2b84b652a23a72f22.tar.gz
gcc-3fb824520b804305f510a9a2b84b652a23a72f22.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-loop-distribution.c7
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 95c64c6..841f2261 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index be0a660..5c8f29d 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);