An interface declaration with an included entry : $ cat z1.f90 module m interface subroutine s entry e end end interface contains subroutine g call s end end $ gfortran -g -O0 -Wall -fcheck=all -c z1.f90 z1.f90:9:0: call s 1 internal compiler error: in gfc_get_extern_function_decl, at fortran/trans-decl.c:1776
Same issue with interface of a function. Compiles if interface is effectivly not used : $ cat z1x.f90 module m interface subroutine s entry e end end interface contains subroutine g end end $ gfortran -g -O0 -Wall -fcheck=all -c z1x.f90
It seems that gfortran is missing a check for ENTRY. F2008 has C1206 (R1205) An interface-body shall not contain a data-stmt, format-stmt, entry-stmt, or stmt-function-stmt.
On Fri, Nov 13, 2015 at 12:42:16AM +0000, kargl at gcc dot gnu.org wrote: > --- Comment #2 from kargl at gcc dot gnu.org --- > It seems that gfortran is missing a check for ENTRY. F2008 has > > C1206 (R1205) An interface-body shall not contain a data-stmt, format-stmt, > entry-stmt, or stmt-function-stmt. > In fact, gfortran is not issues an error for data-stmt, format-stmt, or stmt-function-stmt.
> In fact, gfortran is not issues an error for data-stmt, format-stmt, > or stmt-function-stmt. Confirmed: the following test compiles module m interface subroutine s entry e integer :: x data x /1/ f(x) = x*x 10 format (a) end end interface contains subroutine g end end
Working on this.
On Fri, Nov 13, 2015 at 12:42:16AM +0000, kargl at gcc dot gnu.org wrote: > > It seems that gfortran is missing a check for ENTRY. F2008 has > > C1206 (R1205) An interface-body shall not contain a data-stmt, format-stmt, > entry-stmt, or stmt-function-stmt. > I have a patch for stmt-function-stmt and entry. data-stmt and format-stmt will follow shortly.
On Fri, Nov 13, 2015 at 04:08:05PM +0000, sgk at troutmask dot apl.washington.edu wrote: > --- Comment #6 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- > On Fri, Nov 13, 2015 at 12:42:16AM +0000, kargl at gcc dot gnu.org wrote: > > > > It seems that gfortran is missing a check for ENTRY. F2008 has > > > > C1206 (R1205) An interface-body shall not contain a data-stmt, format-stmt, > > entry-stmt, or stmt-function-stmt. > > > > I have a patch for stmt-function-stmt and entry. > data-stmt and format-stmt will follow shortly. > I now have data-stmt and format-stmt covered. Patch to be submitted later today.
Author: kargl Date: Fri Nov 13 21:11:42 2015 New Revision: 230351 URL: https://gcc.gnu.org/viewcvs?rev=230351&root=gcc&view=rev Log: 2015-11-13 Steven G. Kargl <kargl@gccc.gnu.org> PR fortran/68319 * decl.c (gfc_match_data, gfc_match_entry): Enforce F2008:C1206. * io.c (gfc_match_format): Ditto. * match.c (gfc_match_st_function): Ditto. 2015-11-13 Steven G. Kargl <kargl@gccc.gnu.org> PR fortran/68319 * gfortran.dg/pr68319.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/pr68319.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/decl.c trunk/gcc/fortran/io.c trunk/gcc/fortran/match.c trunk/gcc/testsuite/ChangeLog
Author: kargl Date: Fri Nov 13 21:28:10 2015 New Revision: 230352 URL: https://gcc.gnu.org/viewcvs?rev=230352&root=gcc&view=rev Log: 2015-11-13 Steven G. Kargl <kargl@gccc.gnu.org> PR fortran/68319 * decl.c (gfc_match_data, gfc_match_entry): Enforce F2008:C1206. * io.c (gfc_match_format): Ditto. * match.c (gfc_match_st_function): Ditto. 2015-11-13 Steven G. Kargl <kargl@gccc.gnu.org> PR fortran/68319 * gfortran.dg/pr68319.f90: New test. Added: branches/gcc-5-branch/gcc/testsuite/gfortran.dg/pr68319.f90 Modified: branches/gcc-5-branch/gcc/fortran/ChangeLog branches/gcc-5-branch/gcc/fortran/decl.c branches/gcc-5-branch/gcc/fortran/io.c branches/gcc-5-branch/gcc/fortran/match.c branches/gcc-5-branch/gcc/testsuite/ChangeLog
Fixed on trunk and 5-branch. Thanks for the bug report.