From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BB4953858C74; Tue, 21 Jun 2022 15:57:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB4953858C74 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libgomp/106045] Incorrect testcase in libgomp.c/target-31.c at -O0 Date: Tue, 21 Jun 2022 15:57:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libgomp X-Bugzilla-Version: 10.3.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2022 15:57:41 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106045 --- Comment #1 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:85d613da341b76308edea48359a5dbc7061937c4 commit r13-1190-g85d613da341b76308edea48359a5dbc7061937c4 Author: Jakub Jelinek 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 =3D 0; i < 64; i++) { v =3D 3 * i; ll[i] =3D 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 =3D 0; i < 64; i++) if (ll[i] !=3D u1 + 3 * i * u2[0] + u2[1] + x + y[0] + y[1] + 3= * i + 13 + 14 + i) #pragma omp atomic write err =3D 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 Paul Iannetta PR libgomp/106045 * testsuite/libgomp.c/target-31.c: Add private (i) clause.=