https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77783
Bug ID: 77783 Summary: ICE in gfc_compare_union_types, at fortran/interface.c:545 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: --- Needs option -fdec, affects version 6 and 7 : $ cat z1.f90 subroutine f(x) structure /s1/ union map integer i end map end union end structure record /s1/ x x.i = 0 end subroutine g structure /s1/ union end union end structure record /s1/ x call f(x) end $ gfortran-7-20160925 -fdec -c z1.f90 f951: internal compiler error: Segmentation fault 0xc28c9f crash_signal ../../gcc/toplev.c:337 0x694787 gfc_compare_union_types(gfc_symbol*, gfc_symbol*) ../../gcc/fortran/interface.c:545 0x69469a compare_components ../../gcc/fortran/interface.c:502 0x694918 gfc_compare_derived_types(gfc_symbol*, gfc_symbol*) ../../gcc/fortran/interface.c:633 0x713474 gfc_type_compatible(gfc_typespec*, gfc_typespec*) ../../gcc/fortran/symbol.c:4906 0x6945a8 gfc_compare_types(gfc_typespec*, gfc_typespec*) ../../gcc/fortran/interface.c:693 0x696b8b compare_parameter ../../gcc/fortran/interface.c:2205 0x69792b compare_actual_formal ../../gcc/fortran/interface.c:2876 0x6998cd gfc_procedure_use(gfc_symbol*, gfc_actual_arglist**, locus*) ../../gcc/fortran/interface.c:3611 0x6f382d resolve_global_procedure ../../gcc/fortran/resolve.c:2477 0x6f3ba7 resolve_call ../../gcc/fortran/resolve.c:3455 0x6f0f60 gfc_resolve_code(gfc_code*, gfc_namespace*) ../../gcc/fortran/resolve.c:10758 0x6f3382 resolve_codes ../../gcc/fortran/resolve.c:15724 0x6f347e gfc_resolve(gfc_namespace*) ../../gcc/fortran/resolve.c:15759 0x6ddf9a resolve_all_program_units ../../gcc/fortran/parse.c:5879 0x6ddf9a gfc_parse_file() ../../gcc/fortran/parse.c:6131 0x720d82 gfc_be_parse_file ../../gcc/fortran/f95-lang.c:198