Dear Nicolas,

A long time ago Paul sent me the following patch that fixes all three submodule 
ICEs in pr69498

Index: gcc/fortran/module.c
===================================================================
*** gcc/fortran/module.c        (revision 236994)
--- gcc/fortran/module.c        (working copy)
*************** gfc_match_submodule (void)
*** 744,749 ****
--- 744,756 ----
    if (!gfc_notify_std (GFC_STD_F2008, "SUBMODULE declaration at %C"))
      return MATCH_ERROR;
  
+   if (gfc_current_state () != COMP_NONE)
+     {
+       gfc_error ("SUBMODULE declaration at %C cannot appear within "
+                "another scoping unit");
+       return MATCH_ERROR;
+     }
+ 
    gfc_new_block = NULL;
    gcc_assert (module_list == NULL);
  
Cheers,

Dominique

Reply via email to