public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gscfq@t-online.de" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-99036-4-Tet61BRLkg@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99036-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from G. Steinmetz <gscfq@t-online.de> ---

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=f2008, but invalid for -std=f2003 or -std=f95 :


$ 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=x, exist=f)
   end procedure
end


$ gfortran-12-20211107 -c z2.f90 z3.f90
$
$ gfortran-12-20211107 -c z2.f90 z3.f90 -std=f2003
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

  parent reply	other threads:[~2021-11-10 18:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-09 17:44 [Bug fortran/99036] New: [11 " gscfq@t-online.de
2021-02-10  2:01 ` [Bug fortran/99036] " kargl at gcc dot gnu.org
2021-02-10  7:23 ` rguenth at gcc dot gnu.org
2021-02-10  9:09 ` marxin at gcc dot gnu.org
2021-04-27 11:40 ` [Bug fortran/99036] [11/12 " jakub at gcc dot gnu.org
2021-07-28  7:05 ` rguenth at gcc dot gnu.org
2021-11-10 18:01 ` gscfq@t-online.de [this message]
2021-11-10 21:04 ` kargl at gcc dot gnu.org
2022-04-21  7:48 ` rguenth at gcc dot gnu.org
2023-03-20 20:36 ` [Bug fortran/99036] [11/12/13 " anlauf at gcc dot gnu.org
2023-03-20 20:40 ` anlauf at gcc dot gnu.org
2023-03-20 20:58 ` anlauf at gcc dot gnu.org
2023-03-21 19:01 ` cvs-commit at gcc dot gnu.org
2023-03-22 18:00 ` cvs-commit at gcc dot gnu.org
2023-03-24 18:41 ` cvs-commit at gcc dot gnu.org
2023-03-24 18:43 ` anlauf at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-99036-4-Tet61BRLkg@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).