https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85541
aarograh at umich dot edu changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aarograh at umich dot edu --- Comment #4 from aarograh at umich dot edu --- I've also encountered issues with this in gcc 8.3. Here's my even simpler example that shows the error. The commented code hints at the more complex functionality that I'm actually working toward. MODULE testMod IMPLICIT NONE PUBLIC TYPE :: cache(n) INTEGER,LEN :: n REAL :: a(n) ENDTYPE cache TYPE :: parent TYPE(cache(1)),ALLOCATABLE :: cache ENDTYPE parent ENDMODULE testMod PROGRAM test USE testMod TYPE(cache(1)),ALLOCATABLE :: testcache TYPE(parent) :: testparent ALLOCATE(cache(1) :: testcache) WRITE(*,*) testcache%n WRITE(*,*) testcache%a !ALLOCATE(cache(1) :: testparent%cache) !WRITE(*,*) testparent%cache%n !WRITE(*,*) testparent%cache%a ENDPROGRAM test f951: internal compiler error: in gfc_get_derived_type, at fortran/trans-types.c:2545 0x5c6ca5 gfc_get_derived_type(gfc_symbol*, int) ../../gcc-8.3.0-source/gcc/fortran/trans-types.c:2545 0x748aa8 gfc_get_derived_type(gfc_symbol*, int) ../../gcc-8.3.0-source/gcc/fortran/trans-types.c:2691 0x749498 gfc_typenode_for_spec(gfc_typespec*, int) ../../gcc-8.3.0-source/gcc/fortran/trans-types.c:1203 0x74975c gfc_sym_type(gfc_symbol*) ../../gcc-8.3.0-source/gcc/fortran/trans-types.c:2272 0x74975c gfc_sym_type(gfc_symbol*) ../../gcc-8.3.0-source/gcc/fortran/trans-types.c:2230 0x6f443d gfc_get_symbol_decl(gfc_symbol*) ../../gcc-8.3.0-source/gcc/fortran/trans-decl.c:1739 0x6f6ff8 gfc_create_module_variable ../../gcc-8.3.0-source/gcc/fortran/trans-decl.c:5024 0x6f6ff8 gfc_create_module_variable ../../gcc-8.3.0-source/gcc/fortran/trans-decl.c:4941 0x6bd202 do_traverse_symtree ../../gcc-8.3.0-source/gcc/fortran/symbol.c:4179 0x6f98b3 gfc_generate_module_vars(gfc_namespace*) ../../gcc-8.3.0-source/gcc/fortran/trans-decl.c:5496 0x6d5459 gfc_generate_module_code(gfc_namespace*) ../../gcc-8.3.0-source/gcc/fortran/trans.c:2201 0x6886bb translate_all_program_units ../../gcc-8.3.0-source/gcc/fortran/parse.c:6112 0x6886bb gfc_parse_file() ../../gcc-8.3.0-source/gcc/fortran/parse.c:6328 0x6cefbf gfc_be_parse_file ../../gcc-8.3.0-source/gcc/fortran/f95-lang.c:204 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.