From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8BEE63858022; Wed, 9 Jun 2021 08:39:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BEE63858022 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/90742] OpenACC/OpenMP target offloading: Fortran 'allocatable' scalars in 'firstprivate' clauses Date: Wed, 09 Jun 2021 08:39:28 +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: 10.0 X-Bugzilla-Keywords: openacc, openmp X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: NEW 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: cc bug_status 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: Wed, 09 Jun 2021 08:39:28 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D90742 Tobias Burnus changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu.org Status|WAITING |NEW --- Comment #3 from Tobias Burnus --- Came up in context of my patch for PR92568 (gfortran.dg/gomp/defaultmap-8.f= 90) and the following does not work neither for scalars nor for arrays: integer, allocatable :: a, b(:) a =3D 2 ! implicit allocation b =3D [2] ! implicit allocation !$omp target firstprivate(a,b) if (a /=3D 2 .or. b(1) /=3D 1) stop 1 a =3D 1 b =3D 1 !$omp end target if (a /=3D 2) stop 2 if (b(1) /=3D 2) stop 2 end Namely (for a variant with only the scalar 'a'): .omp_data_arr.2.a =3D a; #pragma omp target num_teams(1) thread_limit(0) firstprivate(a) [child = fn: MAIN__._omp_fn.0 (.omp_data_arr.2, .omp_data_sizes.3, .omp_data_kinds.4)] { .omp_data_i =3D (const struct .omp_data_t.1 & restrict) &.omp_data_= arr.2; D.3963 =3D .omp_data_i->a; a =3D D.3963; { D.3943 =3D *a;=