public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/106045] New: Incorrect testcase in libgomp.c/target-31.c at -O0
@ 2022-06-21 14:20 piannetta at kalrayinc dot com
2022-06-21 15:57 ` [Bug libgomp/106045] " cvs-commit at gcc dot gnu.org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: piannetta at kalrayinc dot com @ 2022-06-21 14:20 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106045
Bug ID: 106045
Summary: Incorrect testcase in libgomp.c/target-31.c at -O0
Product: gcc
Version: 10.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libgomp
Assignee: unassigned at gcc dot gnu.org
Reporter: piannetta at kalrayinc dot com
CC: jakub at gcc dot gnu.org
Target Milestone: ---
Created attachment 53183
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53183&action=edit
patch which add the private clause on i
When investigating a test failure in the openmp testsuite, we found that the
test target-31.c exhibit a wrong behavior at -O0.
This is due to a missing private clause on the i variable. At higher
optimization levels, the i variable is optimized out which makes the wrong
behavior disappear.
In attachment, a patch adding the missing private clause.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libgomp/106045] Incorrect testcase in libgomp.c/target-31.c at -O0
2022-06-21 14:20 [Bug libgomp/106045] New: Incorrect testcase in libgomp.c/target-31.c at -O0 piannetta at kalrayinc dot com
@ 2022-06-21 15:57 ` cvs-commit at gcc dot gnu.org
2022-06-21 16:16 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-06-21 15:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106045
--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:85d613da341b76308edea48359a5dbc7061937c4
commit r13-1190-g85d613da341b76308edea48359a5dbc7061937c4
Author: Jakub Jelinek <jakub@redhat.com>
Date: Tue Jun 21 17:51:08 2022 +0200
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.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libgomp/106045] Incorrect testcase in libgomp.c/target-31.c at -O0
2022-06-21 14:20 [Bug libgomp/106045] New: Incorrect testcase in libgomp.c/target-31.c at -O0 piannetta at kalrayinc dot com
2022-06-21 15:57 ` [Bug libgomp/106045] " cvs-commit at gcc dot gnu.org
@ 2022-06-21 16:16 ` jakub at gcc dot gnu.org
2022-06-28 15:32 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-21 16:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106045
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |FIXED
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Thanks, fixed for 13 now.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libgomp/106045] Incorrect testcase in libgomp.c/target-31.c at -O0
2022-06-21 14:20 [Bug libgomp/106045] New: Incorrect testcase in libgomp.c/target-31.c at -O0 piannetta at kalrayinc dot com
2022-06-21 15:57 ` [Bug libgomp/106045] " cvs-commit at gcc dot gnu.org
2022-06-21 16:16 ` jakub at gcc dot gnu.org
@ 2022-06-28 15:32 ` cvs-commit at gcc dot gnu.org
2022-11-04 8:30 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-06-28 15:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106045
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:d67dfc5f80e537460ebf809758a0e673028ebad7
commit r12-8521-gd67dfc5f80e537460ebf809758a0e673028ebad7
Author: Jakub Jelinek <jakub@redhat.com>
Date: Tue Jun 21 17:51:08 2022 +0200
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.
(cherry picked from commit 85d613da341b76308edea48359a5dbc7061937c4)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libgomp/106045] Incorrect testcase in libgomp.c/target-31.c at -O0
2022-06-21 14:20 [Bug libgomp/106045] New: Incorrect testcase in libgomp.c/target-31.c at -O0 piannetta at kalrayinc dot com
` (2 preceding siblings ...)
2022-06-28 15:32 ` cvs-commit at gcc dot gnu.org
@ 2022-11-04 8:30 ` cvs-commit at gcc dot gnu.org
2022-11-28 22:10 ` pinskia at gcc dot gnu.org
2023-05-03 15:18 ` cvs-commit at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-11-04 8:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106045
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:732e2315e6782bfc93241027f01cd3dfbdb5269c
commit r11-10352-g732e2315e6782bfc93241027f01cd3dfbdb5269c
Author: Jakub Jelinek <jakub@redhat.com>
Date: Tue Jun 21 17:51:08 2022 +0200
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.
(cherry picked from commit 85d613da341b76308edea48359a5dbc7061937c4)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libgomp/106045] Incorrect testcase in libgomp.c/target-31.c at -O0
2022-06-21 14:20 [Bug libgomp/106045] New: Incorrect testcase in libgomp.c/target-31.c at -O0 piannetta at kalrayinc dot com
` (3 preceding siblings ...)
2022-11-04 8:30 ` cvs-commit at gcc dot gnu.org
@ 2022-11-28 22:10 ` pinskia at gcc dot gnu.org
2023-05-03 15:18 ` cvs-commit at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-28 22:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106045
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |11.4
Known to work| |11.3.1, 12.2.0
Known to fail| |11.3.0, 12.1.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libgomp/106045] Incorrect testcase in libgomp.c/target-31.c at -O0
2022-06-21 14:20 [Bug libgomp/106045] New: Incorrect testcase in libgomp.c/target-31.c at -O0 piannetta at kalrayinc dot com
` (4 preceding siblings ...)
2022-11-28 22:10 ` pinskia at gcc dot gnu.org
@ 2023-05-03 15:18 ` cvs-commit at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-03 15:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106045
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:58c396a2ce4f8f66e6c379d74e834e3c8d93f36b
commit r10-11331-g58c396a2ce4f8f66e6c379d74e834e3c8d93f36b
Author: Jakub Jelinek <jakub@redhat.com>
Date: Tue Jun 21 17:51:08 2022 +0200
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.
(cherry picked from commit 85d613da341b76308edea48359a5dbc7061937c4)
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-05-03 15:18 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-21 14:20 [Bug libgomp/106045] New: Incorrect testcase in libgomp.c/target-31.c at -O0 piannetta at kalrayinc dot com
2022-06-21 15:57 ` [Bug libgomp/106045] " cvs-commit at gcc dot gnu.org
2022-06-21 16:16 ` jakub at gcc dot gnu.org
2022-06-28 15:32 ` cvs-commit at gcc dot gnu.org
2022-11-04 8:30 ` cvs-commit at gcc dot gnu.org
2022-11-28 22:10 ` pinskia at gcc dot gnu.org
2023-05-03 15:18 ` cvs-commit at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).