From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D86DB3857719; Wed, 3 May 2023 15:18:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D86DB3857719 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683127112; bh=aeSmXr/7o5Rk/hTvv50YtK9exGCRL2N1h6PIp+fzj5I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ruF21KyQmXzdAV80bx4penLnl/D7GUgxERECovDALpXD2N8c3b6NnPTKQPwiHRZy2 ydyKsGJYZYwjwl1GQBif7JFYSxjjKFtmBDBBXskxOaDeR7FIh8jvj2+R6WH3/0l34H EY7MLjnSuzFN3+Zl3jUKssetnNQmARkCZ1yGgnjA= 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: Wed, 03 May 2023 15:18:32 +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: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.4 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106045 --- Comment #5 from CVS Commits --- The releases/gcc-10 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:58c396a2ce4f8f66e6c379d74e834e3c8d93f36b commit r10-11331-g58c396a2ce4f8f66e6c379d74e834e3c8d93f36b 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. (cherry picked from commit 85d613da341b76308edea48359a5dbc7061937c4)=