From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 305BD3857000; Tue, 9 Aug 2022 18:28:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 305BD3857000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/106566] [OpenMP] declare simd fails with with bogus "already been host associated" for module procedures Date: Tue, 09 Aug 2022 18:28:48 +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: 13.0 X-Bugzilla-Keywords: accepts-invalid, openmp, rejects-valid 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: keywords short_desc 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: Tue, 09 Aug 2022 18:28:48 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106566 Tobias Burnus changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |accepts-invalid Summary|[OpenMP] |[OpenMP] declare simd fails | |with with bogus "already | |been host associated" for | |module procedures --- Comment #1 from Tobias Burnus --- Additionally, the following is not diagnosed =E2=80=93 at least not for thi= s example. "For Fortran, a declarative directive must appear after any USE, IMPORT, and IMPLICIT statements in a declarative context." (The original example shows this issue. This is reported by other compilers= and is being fixed on the OpenMP examples side.) Example - *FAILS* ("has already been host associated") but is *VALID* module m integer, parameter :: NN =3D 1023 integer :: a(NN) contains subroutine add_one2(p) implicit none ! <<<< valid - must before declare !$omp declare simd(add_one2) linear(p: ref) simdlen(8) integer :: p p =3D p + 1 end subroutine end module The following is *COMPILING* - as there is no MODULE: subroutine add_one2(p) !$omp declare simd(add_one2) linear(p: ref) simdlen(8) implicit none ! <<<< invalid because after declare. integer :: p p =3D p + 1 end subroutine Note: This example is on purpose invalid as 'implicit none' has been moved after 'omp declare'. Otherwise, it would be valid.=