https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92960
Bug ID: 92960 Summary: ICE tree check: expected tree that contains 'decl minimal' structure, have 'component_ref' in add_decl_as_local, at fortran/trans-decl.c:261 Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: gs...@t-online.de Target Milestone: --- Affects versions down to gfortran-8 : $ cat z1.f90 program p type t(n) integer, len :: n character(n) :: c end type type(t(:)), allocatable :: z allocate (t(7) :: z) associate (y => z%c) ! print *, y end associate end $ gfortran-10-20191215 -c z1.f90 z1.f90:8:0: 8 | associate (y => z%c) | internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'component_ref' in add_decl_as_local, at fortran/trans-decl.c:261 0x5ef00f tree_contains_struct_check_failed(tree_node const*, tree_node_structure_enum, char const*, int, char const*) ../../gcc/tree.c:9859 0x73e77d contains_struct_check(tree_node*, tree_node_structure_enum, char const*, int, char const*) ../../gcc/tree.h:3387 0x73e77d add_decl_as_local ../../gcc/fortran/trans-decl.c:261 0x73e77d gfc_finish_var_decl ../../gcc/fortran/trans-decl.c:646 0x73d3de gfc_get_symbol_decl(gfc_symbol*) ../../gcc/fortran/trans-decl.c:1829 0x740cbf generate_local_decl ../../gcc/fortran/trans-decl.c:5872 0x6f1dc2 do_traverse_symtree ../../gcc/fortran/symbol.c:4165 0x7358bf generate_local_vars ../../gcc/fortran/trans-decl.c:6078 0x7358bf gfc_process_block_locals(gfc_namespace*) ../../gcc/fortran/trans-decl.c:7089 0x7a7469 gfc_trans_block_construct(gfc_code*) ../../gcc/fortran/trans-stmt.c:2267 0x70b137 trans_code ../../gcc/fortran/trans.c:1960 0x7424cd gfc_generate_function_code(gfc_namespace*) ../../gcc/fortran/trans-decl.c:6801 0x6bc426 translate_all_program_units ../../gcc/fortran/parse.c:6302 0x6bc426 gfc_parse_file() ../../gcc/fortran/parse.c:6541 0x70742f gfc_be_parse_file ../../gcc/fortran/f95-lang.c:210