https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90795
G. Steinmetz <gs...@t-online.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gs...@t-online.de --- Comment #2 from G. Steinmetz <gs...@t-online.de> --- Simplified a bit (and without a submodule) : $ cat z1.f90 module m type t contains final :: f end type type t2 type(t), allocatable :: a end type type t3 type(t2), allocatable :: b(:) end type contains subroutine f(x) type(t) :: x end subroutine g(z) type(t3) :: z deallocate (z%b(1)%a) end end $ gfortran-10-20190922 -c z1.f90 -fcheck=bounds z1.f90:18:0: 18 | deallocate (z%b(1)%a) | internal compiler error: in gfc_build_final_call, at fortran/trans.c:1006 0x6fb0a5 gfc_build_final_call ../../gcc/fortran/trans.c:1006 0x6fb0a5 gfc_add_finalizer_call(stmtblock_t*, gfc_expr*) ../../gcc/fortran/trans.c:1232 0x6fbdd8 gfc_deallocate_scalar_with_status(tree_node*, tree_node*, tree_node*, bool, gfc_expr*, gfc_typespec, bool) ../../gcc/fortran/trans.c:1572 0x796d9f gfc_trans_deallocate(gfc_code*) ../../gcc/fortran/trans-stmt.c:7314 0x6f7757 trans_code ../../gcc/fortran/trans.c:2028 0x72e28d gfc_generate_function_code(gfc_namespace*) ../../gcc/fortran/trans-decl.c:6781 0x6fc8c9 gfc_generate_module_code(gfc_namespace*) ../../gcc/fortran/trans.c:2250 0x6a8c11 translate_all_program_units ../../gcc/fortran/parse.c:6241 0x6a8c11 gfc_parse_file() ../../gcc/fortran/parse.c:6493 0x6f3abf gfc_be_parse_file ../../gcc/fortran/f95-lang.c:204