Hi,
When investigate issues, I ran into this obvious issue that the last candidate
is not related to compare type iv_use.
This patch fixes it. Will apply later.
Thanks,
bin
2017-08-08 Bin Cheng <bin.ch...@arm.com>
* tree-ssa-loop-ivopts.c (relate_compare_use_with_all_cands): Handle
boundary case for the last candidate.
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 1cbff04..b65cd96 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);
}
}