diff options
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/c-omp.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/c-family/c-omp.cc b/gcc/c-family/c-omp.cc index 5bb1035..2ab9911 100644 --- a/gcc/c-family/c-omp.cc +++ b/gcc/c-family/c-omp.cc @@ -1311,10 +1311,11 @@ c_omp_is_loop_iterator (tree decl, struct c_omp_check_loop_iv_data *d) else if (TREE_CODE (TREE_VEC_ELT (d->declv, i)) == TREE_LIST && TREE_CHAIN (TREE_VEC_ELT (d->declv, i)) && (TREE_CODE (TREE_CHAIN (TREE_VEC_ELT (d->declv, i))) - == TREE_VEC) - && decl == TREE_VEC_ELT (TREE_CHAIN (TREE_VEC_ELT (d->declv, - i)), 2)) - return TREE_VEC_LENGTH (d->declv); + == TREE_VEC)) + for (int j = 2; + j < TREE_VEC_LENGTH (TREE_CHAIN (TREE_VEC_ELT (d->declv, i))); j++) + if (decl == TREE_VEC_ELT (TREE_CHAIN (TREE_VEC_ELT (d->declv, i)), j)) + return TREE_VEC_LENGTH (d->declv); return -1; } |