http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58355
Bug ID: 58355 Summary: ICE with TYPE, EXTENDS before parent TYPE defined Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: abensonca at gmail dot com With gfortran 4.9.0 the following causes an ICE: module ct public :: cfc, cfl, cfde type :: cfc end type cfc type, extends(cfl) :: cfde end type cfde type, extends(cfc) :: cfl end type cfl end module ct $ gfortran -v Using built-in specs. COLLECT_GCC=/opt/gcc-trunk/bin/gfortran COLLECT_LTO_WRAPPER=/opt/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-trunk/configure --prefix=/opt/gcc-trunk --enable-languages=c,c++,fortran --disable-multilib Thread model: posix gcc version 4.9.0 20130808 (experimental) (GCC) $ gfortran -c bug.F90 -o bug.o f951: internal compiler error: Segmentation fault 0x97d66f crash_signal ../../gcc-trunk/gcc/toplev.c:335 0x52dec1 check_extended_derived_type ../../gcc-trunk/gcc/fortran/decl.c:7412 0x52dec1 gfc_match_derived_decl() ../../gcc-trunk/gcc/fortran/decl.c:7541 0x5770d9 match_word ../../gcc-trunk/gcc/fortran/parse.c:65 0x578561 decode_statement ../../gcc-trunk/gcc/fortran/parse.c:502 0x5796a4 next_free ../../gcc-trunk/gcc/fortran/parse.c:784 0x5796a4 next_statement ../../gcc-trunk/gcc/fortran/parse.c:977 0x579f34 parse_spec ../../gcc-trunk/gcc/fortran/parse.c:2741 0x57ccf8 parse_module ../../gcc-trunk/gcc/fortran/parse.c:4313 0x57ccf8 gfc_parse_file() ../../gcc-trunk/gcc/fortran/parse.c:4625 0x5b8ce5 gfc_be_parse_file ../../gcc-trunk/gcc/fortran/f95-lang.c:189 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. The PUBLIC statement is required for the ICE to happen. switching the order of the definitions of the "cfde" and "cfl" types results in a success compile. I can't currently test this with the most recent revision of gfortran due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58350