tree-ssa-loop-ivopts.c (relate_compare_use_with_all_cands): Handle boundary case...
authorBin Cheng <bin.cheng@arm.com>
Tue, 8 Aug 2017 14:52:25 +0000 (14:52 +0000)
committerBin Cheng <amker@gcc.gnu.org>
Tue, 8 Aug 2017 14:52:25 +0000 (14:52 +0000)
* tree-ssa-loop-ivopts.c (relate_compare_use_with_all_cands): Handle
boundary case for the last candidate.

From-SVN: r250960

gcc/ChangeLog
gcc/tree-ssa-loop-ivopts.c

index 743e3dbe6ecf5cb1ae33443ab44285d8bf19fc54..e62420b9ccbdc3fa1ed7062d78dbd2991730d078 100644 (file)
@@ -1,3 +1,8 @@
+2017-08-08  Bin Cheng  <bin.cheng@arm.com>
+
+       * tree-ssa-loop-ivopts.c (relate_compare_use_with_all_cands): Handle
+       boundary case for the last candidate.
+
 2017-08-08  Bin Cheng  <bin.cheng@arm.com>
 
        * doc/invoke.texi: Document -ftree-loop-distribution for O3.
index 1cbff04d1e5bf394dd8294b41d2dc3759cfeea04..b65cd96f4ed6c0001df5588521f52ecb28c12e57 100644 (file)
@@ -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);
     }
 }