From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7D3F93858C20; Mon, 7 Mar 2022 13:53:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D3F93858C20 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/104696] [OpenMP] Implicit mapping breaks struct mapping Date: Mon, 07 Mar 2022 13:53:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: missed-optimization, 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: 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: Mon, 07 Mar 2022 13:53:59 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104696 --- Comment #2 from Tobias Burnus --- (In reply to Tobias Burnus from comment #1) > Namely: > ------------ test.c-------------- > struct s { int *d; }; It makes more sense to use 'int d;' to match Fortran. Doing so yields in the gimple dump: #pragma omp target num_teams(1) thread_limit(0) map(struct:x [len: 1]) map(tofrom:x.q.d [len: 4]) #pragma omp target num_teams(1) thread_limit(0) map(tofrom:x [len: 4194328][implicit]) map(tofrom:x.r[1].d [len: 4]) Thus, C and Fortran show the same issue.=