aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2022-08-17 15:45:56 +0200
committerTobias Burnus <tobias@codesourcery.com>2022-08-17 15:45:56 +0200
commitd9c9424d2c4f7b25acfc00db0076a65882c8a99f (patch)
tree30cfc4745cb01959490f0e7a79ca1792cadfb391 /gcc
parent6b4e49fdfcc9bff5459d5a821dd7e9476c7c1c10 (diff)
downloadgcc-d9c9424d2c4f7b25acfc00db0076a65882c8a99f.zip
gcc-d9c9424d2c4f7b25acfc00db0076a65882c8a99f.tar.gz
gcc-d9c9424d2c4f7b25acfc00db0076a65882c8a99f.tar.bz2
OpenMP: Fix var replacement with 'simd' and linear-step vars [PR106548]
gcc/ChangeLog: PR middle-end/106548 * omp-low.cc (lower_rec_input_clauses): Use build_outer_var_ref for 'simd' linear-step values that are variable. libgomp/ChangeLog: PR middle-end/106548 * testsuite/libgomp.c/linear-2.c: New test.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/omp-low.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/omp-low.cc b/gcc/omp-low.cc
index 3c4b859..fdf34d6 100644
--- a/gcc/omp-low.cc
+++ b/gcc/omp-low.cc
@@ -6188,6 +6188,8 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
&& gimple_omp_for_combined_into_p (ctx->stmt))
{
tree t = OMP_CLAUSE_LINEAR_STEP (c);
+ if (DECL_P (t))
+ t = build_outer_var_ref (t, ctx);
tree stept = TREE_TYPE (t);
tree ct = omp_find_clause (clauses,
OMP_CLAUSE__LOOPTEMP_);