https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79311
Bug ID: 79311 Summary: internal compiler error: generate_finalization_wrapper Product: gcc Version: 6.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: liakhdi at ornl dot gov Target Milestone: --- Created attachment 40641 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40641&action=edit Source reproducer Below is the GFORTRAN internal compiler error backtrace I encountered. There are four source files in the attachment and a simple make script. Files dil_basic.F90, tensor_algebra.F90, and stsubs.F90 are just auxiliary utilities. The problematic source file is tensor_recursive.F90. There are three classes defined there: tens_signature_t, tens_shape_t, and tens_header_t. The latter class contains two components of the former types (tens_signature_t and tens_shape_t). While Final subroutines in the tens_signature_t and tens_shape_t compile fine, the Final subroutine in the composite class fails to compile with an internal compiler error (below). If you comment it in the type declaration (tens_header_t), it will compile. Please help fixing this issue: f951: internal compiler error: in generate_finalization_wrapper, at fortran/class.c:1972 0x63e92a generate_finalization_wrapper ../../cray-gcc-6.2.0/gcc/fortran/class.c:1972 0x63e92a gfc_find_derived_vtab(gfc_symbol*) ../../cray-gcc-6.2.0/gcc/fortran/class.c:2404 0x63fcf5 finalize_component ../../cray-gcc-6.2.0/gcc/fortran/class.c:995 0x63ed9e generate_finalization_wrapper ../../cray-gcc-6.2.0/gcc/fortran/class.c:2128 0x63ed9e gfc_find_derived_vtab(gfc_symbol*) ../../cray-gcc-6.2.0/gcc/fortran/class.c:2404 0x6b02e0 gfc_resolve_finalizers ../../cray-gcc-6.2.0/gcc/fortran/resolve.c:12198 0x6c5573 resolve_fl_derived ../../cray-gcc-6.2.0/gcc/fortran/resolve.c:13463 0x6c0476 resolve_symbol ../../cray-gcc-6.2.0/gcc/fortran/resolve.c:13762 0x6d9dbb do_traverse_symtree ../../cray-gcc-6.2.0/gcc/fortran/symbol.c:3926 0x6c36aa resolve_types ../../cray-gcc-6.2.0/gcc/fortran/resolve.c:15555 0x6bf0df gfc_resolve(gfc_namespace*) ../../cray-gcc-6.2.0/gcc/fortran/resolve.c:15665 0x6aaaf4 gfc_parse_file() ../../cray-gcc-6.2.0/gcc/fortran/parse.c:6059 0x6ebed2 gfc_be_parse_file ../../cray-gcc-6.2.0/gcc/fortran/f95-lang.c:201