From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 69E653858D28; Thu, 25 Nov 2021 11:21:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 69E653858D28 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/103416] [12 Regression][OpenMP] Bogus firstprivate(n) map(to:n [len: 4][implicit]) Date: Thu, 25 Nov 2021 11:21:22 +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: 12.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: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created 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: Thu, 25 Nov 2021 11:21:22 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103416 --- Comment #4 from Tobias Burnus --- Created attachment 51872 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D51872&action=3Dedit RFC Patch to avoid the pointless evaluation, see comment 4 (In reply to Tobias Burnus from comment #3) > * Why is the var generated in the parent scope of 'omp target' instead of > inside 'omp target'? The problem is a forced evaluation of the array bounds, which I regard as pointless if the variable is just a plain variable - no array ref, not stru= ct ref no ... Cf. attachment. (The question is when 'force=3Dtrue' is needed and whether = the DECL_P check is the right one or whether more or less should be permitted.) This is indeed the same as issue as PR80330 (8...) * * * The libgomp: cuCtxSynchronize error: misaligned address is a regression =E2=80=93 see comment 1 for a patch which fixes it. This is= PR90030 (9...) * * * > * Why is 'map(to:' and not 'firstprivate' used? Because of: gfc_omp_predetermined_mapping (tree decl) { if (DECL_ARTIFICIAL (decl) && ! GFC_DECL_RESULT (decl) && ! (DECL_LANG_SPECIFIC (decl) && GFC_DECL_SAVED_DESCRIPTOR (decl))) return OMP_CLAUSE_DEFAULTMAP_TO; I wonder whether OMP_DEFAULTMAP_FIRSTPRIVATE wouldn't make more sense in t= his case =E2=80=93 at least for gfc_omp_scalar_target_p ? Which is also related to PR80330 (8...)=