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;