https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90111
Bug ID: 90111 Summary: Placement of Fortran OpenACC 'routine' directive inside 'specification-part' Product: gcc Version: 9.0 Status: UNCONFIRMED Keywords: openacc, rejects-valid Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: tschwinge at gcc dot gnu.org Target Milestone: --- OpenACC 2.7 (same in 2.6), in section 2.15.1. "Routine Directive" states that "In Fortran, the 'routine' directive without a name may appear within the specification part of a subroutine or function definition, or within an interface body for a subroutine or function in an interface block, and applies to the containing subroutine or function. 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". It therefore seems wrong to me that the following gets rejected: subroutine s !$acc routine seq implicit none integer :: i i = 0 end subroutine s 2 | !$acc routine seq | 2 3 | implicit none | 1containi Error: IMPLICIT NONE statement at (1) cannot follow !$ACC ROUTINE statement at (2) Or am I misunderstanding something about 'implicit-stmt'? But at least for the 'routine' directive without a name, which always implicitly applies to the containing subprogram etc., this placement should not matter at all (thus, the above be valid). I have not looked for any other such rejects-valid constructs.