From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 55E97385803F; Wed, 10 Nov 2021 18:01:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 55E97385803F From: "gscfq@t-online.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/99036] [11/12 Regression] ICE in gfc_current_interface_head, at fortran/interface.c:4699 Date: Wed, 10 Nov 2021 18:01:43 +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: 11.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: gscfq@t-online.de 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: 11.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: Wed, 10 Nov 2021 18:01:43 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99036 --- Comment #5 from G. Steinmetz --- Another try with a case that is probably/hopefully related. The following example with a module and submodule in different files is valid for e.g. -std=3Df2008, but invalid for -std=3Df2003 or -std=3Df95 : $ cat z2.f90 module m interface module logical function f(x) character(*), intent(in) :: x end end interface end $ cat z3.f90 submodule(m) m2 contains module procedure f inquire (file=3Dx, exist=3Df) end procedure end $ gfortran-12-20211107 -c z2.f90 z3.f90 $ $ gfortran-12-20211107 -c z2.f90 z3.f90 -std=3Df2003 z2.f90:3:14: 3 | module logical function f(x) | 1 Error: Fortran 2008: MODULE prefix at (1) z2.f90:4:38: 4 | character(*), intent(in) :: x | 1 Error: Unexpected data declaration statement in INTERFACE block at (1) z2.f90:5:9: 5 | end | 1 Error: END INTERFACE statement expected at (1) z3.f90:1:10: 1 | submodule(m) m2 | 1 Error: Fortran 2008: SUBMODULE declaration at (1) f951: internal compiler error: in gfc_current_interface_head, at fortran/interface.c:4842 0x7e9464 gfc_current_interface_head() ../../gcc/fortran/interface.c:4842 0x7c4385 gfc_match_modproc() ../../gcc/fortran/decl.c:9978 0x82d421 match_word ../../gcc/fortran/parse.c:67 0x832630 decode_statement ../../gcc/fortran/parse.c:524 0x83317a next_free ../../gcc/fortran/parse.c:1388 0x83317a next_statement ../../gcc/fortran/parse.c:1620 0x837f6c parse_contained ../../gcc/fortran/parse.c:6017 0x837e96 parse_progunit ../../gcc/fortran/parse.c:6242 0x838c4c gfc_parse_file() ../../gcc/fortran/parse.c:6763 0x886d7f gfc_be_parse_file ../../gcc/fortran/f95-lang.c:216=