public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/106566] New: [OpenMP]
@ 2022-08-08 20:35 burnus at gcc dot gnu.org
  2022-08-09 18:28 ` [Bug fortran/106566] [OpenMP] declare simd fails with with bogus "already been host associated" for module procedures burnus at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2022-08-08 20:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106566

            Bug ID: 106566
           Summary: [OpenMP]
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: openmp, rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

The OpenMP example
https://github.com/OpenMP/Examples/blob/v5.2/SIMD/sources/linear_modifier.1.f90
is rejected as:

   13 |    !$omp declare simd(add_one2) linear(p: ref) simdlen(8)
      |                               1
Error: Symbol ‘add_one2’ at (1) has already been host associated

if it is a module procedure. When commenting the 'module ... contains' and 'end
module', it compiles just fine.

(Similar the .2 and .3 in the examples.)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/106566] [OpenMP] declare simd fails with with bogus "already been host associated" for module procedures
  2022-08-08 20:35 [Bug fortran/106566] New: [OpenMP] burnus at gcc dot gnu.org
@ 2022-08-09 18:28 ` burnus at gcc dot gnu.org
  2022-08-16  8:16 ` burnus at gcc dot gnu.org
  2022-08-16 15:26 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2022-08-09 18:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106566

Tobias Burnus <burnus at gcc dot gnu.org> 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 <burnus at gcc dot gnu.org> ---
Additionally, the following is not diagnosed – at least not for this 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 = 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 = 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 = 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/106566] [OpenMP] declare simd fails with with bogus "already been host associated" for module procedures
  2022-08-08 20:35 [Bug fortran/106566] New: [OpenMP] burnus at gcc dot gnu.org
  2022-08-09 18:28 ` [Bug fortran/106566] [OpenMP] declare simd fails with with bogus "already been host associated" for module procedures burnus at gcc dot gnu.org
@ 2022-08-16  8:16 ` burnus at gcc dot gnu.org
  2022-08-16 15:26 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2022-08-16  8:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106566

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
The ordering part (must be after IMPORT/IMPLICIT/USE) is now tracked in
PR106639 - note that forcing it after IMPORT/IMPLICIT/USE is new since OpenMP
5.1.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/106566] [OpenMP] declare simd fails with with bogus "already been host associated" for module procedures
  2022-08-08 20:35 [Bug fortran/106566] New: [OpenMP] burnus at gcc dot gnu.org
  2022-08-09 18:28 ` [Bug fortran/106566] [OpenMP] declare simd fails with with bogus "already been host associated" for module procedures burnus at gcc dot gnu.org
  2022-08-16  8:16 ` burnus at gcc dot gnu.org
@ 2022-08-16 15:26 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2022-08-16 15:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106566

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Patch for the rejects-valid issue of module variable + a fix
for an absent linear step with OpenMP 5.2 syntax:
  https://gcc.gnu.org/pipermail/gcc-patches/2022-August/599829.html

As mentioned, the declarative directive before IMPORT/IMPLICIT/USE issue
is a only invalid since OpenMP 5.1 - and tracked in PR106639.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-16 15:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-08 20:35 [Bug fortran/106566] New: [OpenMP] burnus at gcc dot gnu.org
2022-08-09 18:28 ` [Bug fortran/106566] [OpenMP] declare simd fails with with bogus "already been host associated" for module procedures burnus at gcc dot gnu.org
2022-08-16  8:16 ` burnus at gcc dot gnu.org
2022-08-16 15:26 ` burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).