public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/98915] New: OpenACC routine with a name directive does not compile
@ 2021-02-01 11:49 kd486 at cam dot ac.uk
  2021-02-01 11:58 ` [Bug fortran/98915] " kd486 at cam dot ac.uk
  2021-02-01 14:19 ` [Bug fortran/98915] OpenACC 'routine with a name' " burnus at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: kd486 at cam dot ac.uk @ 2021-02-01 11:49 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98915
           Summary: OpenACC routine with a name directive does not compile
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kd486 at cam dot ac.uk
  Target Milestone: ---

Created attachment 50106
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50106&action=edit
Module file to reproduce issue

The OpenACC standard states that "The routine directive with a name may appear
in the specification part of a subroutine, function or module, and applies to
the named subroutine or function."

However, the following does not compile with Gfortran:

        function modifier(x) result(y)
            implicit none
            !$acc routine seq
            real(kind =8) :: x,y
            y = 2 * x
        end function modifier

        subroutine do_work
            implicit none
            !$acc routine(modifier) seq
            integer(kind = 4) :: i
            !$acc parallel loop collapse(3) independent private(i)
            do i = 1,q
            x(i,j,k) = 23.
            x(i,j,k) = modifier(x(i))
            end do
        end subroutine do_work

 gfortran -fopenacc -Wall -Wextra -c mymodule.f90
mymodule.f90:26:35:

   26 |             !$acc routine(modifier) seq
      |                                   1
Error: Invalid NAME ‘modifier’ in !$ACC ROUTINE ( NAME ) at (1)

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

* [Bug fortran/98915] OpenACC routine with a name directive does not compile
  2021-02-01 11:49 [Bug fortran/98915] New: OpenACC routine with a name directive does not compile kd486 at cam dot ac.uk
@ 2021-02-01 11:58 ` kd486 at cam dot ac.uk
  2021-02-01 14:19 ` [Bug fortran/98915] OpenACC 'routine with a name' " burnus at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: kd486 at cam dot ac.uk @ 2021-02-01 11:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Kiril Dichev <kd486 at cam dot ac.uk> ---
See attached file for reference, snippet in description is not quite correct as
I was trying to be brief

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

* [Bug fortran/98915] OpenACC 'routine with a name' directive does not compile
  2021-02-01 11:49 [Bug fortran/98915] New: OpenACC routine with a name directive does not compile kd486 at cam dot ac.uk
  2021-02-01 11:58 ` [Bug fortran/98915] " kd486 at cam dot ac.uk
@ 2021-02-01 14:19 ` burnus at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-02-01 14:19 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(Now: OpenACC spec issue #345)

I am not sure that a use as in attachment 50106 is really intended, namely:
placing the "acc routine" into a sibling procedure.

However, gfortran seems to reject too much – at least with the current wording.

The problem is that the diagnostic already happens at call time
(gfc_match_oacc_routine) which requires that the symbol has been encountered
before (during parsing) and the usage is such that it has to be in the current
scope and cannot be in the parent scope.

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

end of thread, other threads:[~2021-02-01 14:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01 11:49 [Bug fortran/98915] New: OpenACC routine with a name directive does not compile kd486 at cam dot ac.uk
2021-02-01 11:58 ` [Bug fortran/98915] " kd486 at cam dot ac.uk
2021-02-01 14:19 ` [Bug fortran/98915] OpenACC 'routine with a name' " 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).