From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AB2753858D32; Mon, 8 May 2023 15:29:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB2753858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683559755; bh=EGuQKH0okxxpi3RzhfiLBWrZaQAvyQBa122b7qHkFio=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HzzfpmxKwqL7KLEmY8bDBd79BjmDe6j+J8UUcwpms6ApUArCcxODE62KgG4FNhsWw OsYaNJa+tsYllhTHRJe+yAhaSIEb4nERHAmdznjI3EgcXjv9NqAuBsF7hsm1R6y0zm JHatIpgWfVE+l16WzZGoJhKaJNOp6cw7vESmTcK4= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/109767] [OpenMP][5.2] Missing loop-variable privatization inside 'teams' Date: Mon, 08 May 2023 15:29:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: openmp, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109767 --- Comment #4 from Jakub Jelinek --- Ah, ok, I see what do you mean. The thing is that the implementation of loop bind(teams) as distribute para= llel do simd is effectively just an implementation detail, and per the spec j is not pri= vate in the loop construct, but private on teams. I think we need to discuss this in lang committee then (what behavior is for int i, j; #pragma omp teams private (j) { #pragma omp loop bind(teams) for (i =3D 0; i < 16; ++i) for (j =3D 0; j < 16; ++j) ; } ). Obviously, if private (j) is on omp loop rather than omp teams, it has to w= ork as expected.=