From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E8D7E3858D29; Sat, 2 Jan 2021 01:32:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E8D7E3858D29 From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/96986] [8/9/10/11 Regression] Explicit interface required: volatile argument for ENTRY subroutine Date: Sat, 02 Jan 2021 01:32:24 +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: 8.3.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 8.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc priority 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: Sat, 02 Jan 2021 01:32:25 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96986 kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu.org Priority|P5 |P4 Status|WAITING |NEW --- Comment #5 from kargl at gcc dot gnu.org --- The code is valid. Gfortran error message is bogus. The pertinent part of the Fortran standard is the last sentence here: If the ENTRY statement is in a subroutine subprogram, an additional subroutine is defined by that subprogram. The name of the subroutine is entry-name. The dummy arguments of the subroutine are those specified in the ENTRY statement The entry statement 'entry func_a()' in question has no dummy arguments. The portion of the Fortran standard quoted in comment #2 clearly does not apply. Also note that the requirement of an explicit interface comes if a programmer wants to call 'entry func_b(va)'. Thus, the following code is also conforming. subroutine bar(va) integer, volatile :: va va =3D 42 end subroutine bar program foo integer n interface subroutine bar(va) integer, volatile :: va end subroutine bar end interface call bar(n) print *, n end program foo=