From 7d27b70bd861d6b83a6821e3fb4205e19a365310 Mon Sep 17 00:00:00 2001 From: Bin Cheng Date: Tue, 8 Aug 2017 14:52:25 +0000 Subject: [PATCH] tree-ssa-loop-ivopts.c (relate_compare_use_with_all_cands): Handle boundary case for the last candidate. * tree-ssa-loop-ivopts.c (relate_compare_use_with_all_cands): Handle boundary case for the last candidate. From-SVN: r250960 --- gcc/ChangeLog | 5 +++++ gcc/tree-ssa-loop-ivopts.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 743e3dbe6ec..e62420b9ccb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-08-08 Bin Cheng + + * tree-ssa-loop-ivopts.c (relate_compare_use_with_all_cands): Handle + boundary case for the last candidate. + 2017-08-08 Bin Cheng * doc/invoke.texi: Document -ftree-loop-distribution for O3. diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 1cbff04d1e5..b65cd96f4ed 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -5284,13 +5284,13 @@ set_autoinc_for_original_candidates (struct ivopts_data *data) static void relate_compare_use_with_all_cands (struct ivopts_data *data) { - unsigned i, max_id = data->vcands.length () - 1; + unsigned i, count = data->vcands.length (); for (i = 0; i < data->vgroups.length (); i++) { struct iv_group *group = data->vgroups[i]; if (group->type == USE_COMPARE) - bitmap_set_range (group->related_cands, 0, max_id); + bitmap_set_range (group->related_cands, 0, count); } } -- 2.30.2