https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95710
--- Comment #3 from G. Steinmetz <gs...@t-online.de> --- A few more related test files : $ cat zz1.f90 module m interface module subroutine s end end interface end submodule(m) m2 contains subroutine s class(*), allocatable :: x class(*), allocatable :: x end end $ cat zz2.f90 module m interface module function s() end end interface end submodule(m) m2 contains function s() class(*), allocatable :: x class(*), allocatable :: x end end $ cat zz3.f90 program p interface module function s() class(*), allocatable :: s class(*), allocatable :: s end end interface end $ gfortran-12-20211107 -c zz3.f90 f951: internal compiler error: Segmentation fault 0xd4f7bf crash_signal ../../gcc/toplev.c:322 0x811d2e resolve_symbol ../../gcc/fortran/resolve.c:15582 0x830df2 do_traverse_symtree ../../gcc/fortran/symbol.c:4172 0x815254 resolve_types ../../gcc/fortran/resolve.c:17453 0x81081c gfc_resolve(gfc_namespace*) ../../gcc/fortran/resolve.c:17568 0x7f8ae4 resolve_all_program_units ../../gcc/fortran/parse.c:6564 0x7f8ae4 gfc_parse_file() ../../gcc/fortran/parse.c:6820 0x845d3f gfc_be_parse_file ../../gcc/fortran/f95-lang.c:216