public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/107596] New: ICE in gfc_match_submodule, at fortran/module.cc:773
@ 2022-11-09 17:56 gscfq@t-online.de
  2022-11-09 21:42 ` [Bug fortran/107596] " kargl at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: gscfq@t-online.de @ 2022-11-09 17:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107596
           Summary: ICE in gfc_match_submodule, at fortran/module.cc:773
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Started with r6 :


$ cat z1.f90
submodule(m)
submodule(m)


$ cat z2.f90
module m
end
submodule(m)1
submodule(m)2
end


$ gfortran-13-20221106 -c z1.f90
z1.f90:1:12:

    1 | submodule(m)
      |            1
Error: Syntax error in SUBMODULE statement at (1)
f951: internal compiler error: in gfc_match_submodule, at fortran/module.cc:773
0x83b802 gfc_match_submodule()
        ../../gcc/fortran/module.cc:773
0x855df1 match_word
        ../../gcc/fortran/parse.cc:67
0x85b8cd decode_statement
        ../../gcc/fortran/parse.cc:564
0x85be8a next_free
        ../../gcc/fortran/parse.cc:1402
0x85be8a next_statement
        ../../gcc/fortran/parse.cc:1634
0x861e39 gfc_parse_file()
        ../../gcc/fortran/parse.cc:6765
0x8b0c8f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.cc:229

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug fortran/107596] ICE in gfc_match_submodule, at fortran/module.cc:773
  2022-11-09 17:56 [Bug fortran/107596] New: ICE in gfc_match_submodule, at fortran/module.cc:773 gscfq@t-online.de
@ 2022-11-09 21:42 ` kargl at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: kargl at gcc dot gnu.org @ 2022-11-09 21:42 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-11-09
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from kargl at gcc dot gnu.org ---
Instead of an assert, just jump to a syntax error.

diff --git a/gcc/fortran/module.cc b/gcc/fortran/module.cc
index 5ddabdcff4d..b41e425ac8f 100644
--- a/gcc/fortran/module.cc
+++ b/gcc/fortran/module.cc
@@ -770,7 +770,8 @@ gfc_match_submodule (void)
     }

   gfc_new_block = NULL;
-  gcc_assert (module_list == NULL);
+  if (module_list == NULL)
+    goto syntax;

   if (gfc_match_char ('(') != MATCH_YES)
     goto syntax;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-09 21:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 17:56 [Bug fortran/107596] New: ICE in gfc_match_submodule, at fortran/module.cc:773 gscfq@t-online.de
2022-11-09 21:42 ` [Bug fortran/107596] " kargl at gcc dot gnu.org

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).