https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78277
Bug ID: 78277 Summary: ICE in is_anonymous_component, at fortran/interface.c:450 Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: gerhard.steinmetz.fort...@t-online.de Target Milestone: --- Invalid code together with option -fdec, affects versions 6 and 7 : $ cat z1.f90 subroutine sub1() structure /s/ structure t integer i end structure end structure record /s/ u interface subroutine sub0(u) structure /s/ structure t. integer i end structure end structure record /s/ u end end interface call sub0(u) end $ gfortran-7-20161106 -fdec -c z1.f90 z1.f90:11:19: structure t. 1 Error: Syntax error in data declaration at (1) z1.f90:14:9: end structure 1 Error: Expecting END SUBROUTINE statement at (1) f951: internal compiler error: Segmentation fault 0xc3a64f crash_signal ../../gcc/toplev.c:338 0x6952d0 is_anonymous_component ../../gcc/fortran/interface.c:450 0x696cca compare_components ../../gcc/fortran/interface.c:479 0x697078 gfc_compare_derived_types(gfc_symbol*, gfc_symbol*) ../../gcc/fortran/interface.c:666 0x717e8b gfc_type_compatible(gfc_typespec*, gfc_typespec*) ../../gcc/fortran/symbol.c:4905 0x696c3d gfc_compare_types(gfc_typespec*, gfc_typespec*) ../../gcc/fortran/interface.c:727 0x696d2f compare_components ../../gcc/fortran/interface.c:513 0x697078 gfc_compare_derived_types(gfc_symbol*, gfc_symbol*) ../../gcc/fortran/interface.c:666 0x717e8b gfc_type_compatible(gfc_typespec*, gfc_typespec*) ../../gcc/fortran/symbol.c:4905 0x696c3d gfc_compare_types(gfc_typespec*, gfc_typespec*) ../../gcc/fortran/interface.c:727 0x69934b compare_parameter ../../gcc/fortran/interface.c:2252 0x69a0eb compare_actual_formal ../../gcc/fortran/interface.c:2924 0x69c09d gfc_procedure_use(gfc_symbol*, gfc_actual_arglist**, locus*) ../../gcc/fortran/interface.c:3661 0x6f8065 resolve_specific_s0 ../../gcc/fortran/resolve.c:3303 0x6f8065 resolve_specific_s ../../gcc/fortran/resolve.c:3323 0x6f8065 resolve_call ../../gcc/fortran/resolve.c:3477 0x6f4f43 gfc_resolve_code(gfc_code*, gfc_namespace*) ../../gcc/fortran/resolve.c:10994 0x6f75c2 resolve_codes ../../gcc/fortran/resolve.c:15994 0x6f76be gfc_resolve(gfc_namespace*) ../../gcc/fortran/resolve.c:16029 0x6e1bba resolve_all_program_units ../../gcc/fortran/parse.c:5883