From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CA5753858D20; Wed, 12 Jul 2023 09:32:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA5753858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689154380; bh=iKIoTjkQnM/8IXMGF5ftWlOAHZKpsPJxZEneMLGeCO8=; h=From:To:Subject:Date:From; b=POOo9gr04EXAulVOFN8td2jzZtIrInN/lSzi8GEU1cNlR27+wmYBaVoqyFoDQvJEl CZd9dTXERurqWScuVKKn588pvxQKzE4BAG6LF2+h7mGWpwcyixVUQxK8FDqOmfi1ID RgrTrakrCH/+kY3kaM6vWSOguf9Edcz6W1+1Si18= From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/110639] New: [OpenMP][5.1] Predefined firstprivate for pointers - attachment missing Date: Wed, 12 Jul 2023 09:32:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: openmp, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D110639 Bug ID: 110639 Summary: [OpenMP][5.1] Predefined firstprivate for pointers - attachment missing Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: openmp, wrong-code Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org Target Milestone: --- OpenMP 5.1 changed (quoting GCC impl. status): Pointer predetermined firstprivate getting initialized to address of matchi= ng mapped list item per 5.1, Sect. 2.21.7.2 However, looking at the examples in the OpenMP spec issue #1796 (TRAC864) t= his does not handle partially mapped data correctly: int a[100]; int *p =3D &a[0]; #pragma omp target teams distribute map(a[start:n]) for (int i =3D start; i < start+n; i++) { p[i] =3D f(p[i], i); } Here, 'p' has an points to 'a' (actually, to the base address of 'a') but t= his address is not mapped. However, it still points to the extended address ra= nge of mapped data.=