diff options
author | Jakub Jelinek <jakub@redhat.com> | 2022-06-21 17:51:08 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2022-06-21 17:51:08 +0200 |
commit | 85d613da341b76308edea48359a5dbc7061937c4 (patch) | |
tree | 1331a2c23dbd117d86110acbd4b1f0b7d85bb556 /libgomp | |
parent | 7905a9ac26707ed6ac49e40e35a9c8755c6574e3 (diff) | |
download | gcc-85d613da341b76308edea48359a5dbc7061937c4.zip gcc-85d613da341b76308edea48359a5dbc7061937c4.tar.gz gcc-85d613da341b76308edea48359a5dbc7061937c4.tar.bz2 |
libgomp: Fix up target-31.c test [PR106045]
The i variable is used inside of the parallel in:
#pragma omp simd safelen(32) private (v)
for (i = 0; i < 64; i++)
{
v = 3 * i;
ll[i] = u1 + v * u2[0] + u2[1] + x + y[0] + y[1] + v + h[0] + u3[i];
}
where i is predetermined linear (so while inside of the body
it is safe, private per SIMD lane var) the final value is written to
the shared variable, and in:
for (i = 0; i < 64; i++)
if (ll[i] != u1 + 3 * i * u2[0] + u2[1] + x + y[0] + y[1] + 3 * i + 13 + 14 + i)
#pragma omp atomic write
err = 1;
which is a normal loop and so it isn't in any way privatized there.
So we have a data race, fixed by adding private (i) clause to the
parallel.
2022-06-21 Jakub Jelinek <jakub@redhat.com>
Paul Iannetta <piannetta@kalrayinc.com>
PR libgomp/106045
* testsuite/libgomp.c/target-31.c: Add private (i) clause.
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/testsuite/libgomp.c/target-31.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libgomp/testsuite/libgomp.c/target-31.c b/libgomp/testsuite/libgomp.c/target-31.c index 8e63d28..1123b7e 100644 --- a/libgomp/testsuite/libgomp.c/target-31.c +++ b/libgomp/testsuite/libgomp.c/target-31.c @@ -76,7 +76,7 @@ main () m[1] += 3 * b; } use (&a, &b, &c, &d, e, f, g, h); - #pragma omp parallel firstprivate (u1, u2) + #pragma omp parallel firstprivate (u1, u2) private (i) { int w = omp_get_thread_num (); int x = 19; |