aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gimplify.cc')
-rw-r--r--gcc/gimplify.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
index 422ad12..a8399dc 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -3949,6 +3949,7 @@ modify_call_for_omp_dispatch (tree expr, tree dispatch_clauses,
: DECL_SOURCE_LOCATION (fndecl),
"%<declare variant%> candidate %qD declared here",
fndecl);
+ ninterop = nappend;
}
}
if (dispatch_interop && !dispatch_device_num)
@@ -3971,7 +3972,7 @@ modify_call_for_omp_dispatch (tree expr, tree dispatch_clauses,
buffer[i] = CALL_EXPR_ARG (expr, i);
}
int j = ninterop;
- for (tree t = dispatch_interop; t; t = TREE_CHAIN (t))
+ for (tree t = dispatch_interop; t && j > 0; t = TREE_CHAIN (t))
if (OMP_CLAUSE_CODE (t) == OMP_CLAUSE_INTEROP)
buffer[i + --j] = OMP_CLAUSE_DECL (t);
gcc_checking_assert (j == 0);