https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92587
Bug ID: 92587 Summary: Compiler is unable to generate finalization wrapper Product: gcc Version: 9.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 47304 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47304&action=edit Complete reproducer of the reported ICE There is a regression ICE introduced in gfortran/9.x (all versions up to 9.2.0 produce this ICE). The compiler reports ICE in generate_finalization_wrapper (see below). The complete reproducer is attached (please run make.sh to build it). I could not reduce it yet to a single small source file as stripping things off makes the ICE disappear, so I apologize for supplying multiple source files. Importantly this code compiles fine with gfortran/8.x, so this ICE was introduced in gfortran/9 very early, when gfortran/9 was not yet released. My system is Ubuntu 16.04 with the gcc/9.2.0 release installed from source. gfortran -c -g tensor_recursive.F90 f951: internal compiler error: in generate_finalization_wrapper, at fortran/class.c:2009 0x588c29 generate_finalization_wrapper /home/dima/src/gcc-9.2.0/gcc/fortran/class.c:2009 0x588c29 gfc_find_derived_vtab(gfc_symbol*) /home/dima/src/gcc-9.2.0/gcc/fortran/class.c:2484 0x5e1891 gfc_find_vtab(gfc_typespec*) /home/dima/src/gcc-9.2.0/gcc/fortran/class.c:2865 0x5e1891 gfc_find_vtab(gfc_typespec*) /home/dima/src/gcc-9.2.0/gcc/fortran/class.c:2855 0x62f9b2 gfc_match_assignment() /home/dima/src/gcc-9.2.0/gcc/fortran/match.c:1378 0x64f3f4 match_word /home/dima/src/gcc-9.2.0/gcc/fortran/parse.c:65 0x64f3f4 decode_statement /home/dima/src/gcc-9.2.0/gcc/fortran/parse.c:361 0x652f24 next_free /home/dima/src/gcc-9.2.0/gcc/fortran/parse.c:1241 0x652f24 next_statement /home/dima/src/gcc-9.2.0/gcc/fortran/parse.c:1473 0x655a89 parse_executable /home/dima/src/gcc-9.2.0/gcc/fortran/parse.c:5436 0x6563a1 parse_if_block /home/dima/src/gcc-9.2.0/gcc/fortran/parse.c:4079 0x6563a1 parse_executable /home/dima/src/gcc-9.2.0/gcc/fortran/parse.c:5329 0x6563a1 parse_if_block /home/dima/src/gcc-9.2.0/gcc/fortran/parse.c:4079 0x6563a1 parse_executable /home/dima/src/gcc-9.2.0/gcc/fortran/parse.c:5329 0x656e06 parse_progunit /home/dima/src/gcc-9.2.0/gcc/fortran/parse.c:5706 0x65715e parse_contained /home/dima/src/gcc-9.2.0/gcc/fortran/parse.c:5581 0x657e5e parse_module /home/dima/src/gcc-9.2.0/gcc/fortran/parse.c:5953 0x6582ad gfc_parse_file() /home/dima/src/gcc-9.2.0/gcc/fortran/parse.c:6256 0x6a170f gfc_be_parse_file /home/dima/src/gcc-9.2.0/gcc/fortran/f95-lang.c:204 Thanks, Dmitry