https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84244
Bug ID: 84244 Summary: [7/8 Regression] ICE in recompute_tree_invariant_for_addr_expr, at tree.c:4535 Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: gs...@t-online.de Target Milestone: --- Function f in z1.f90 is not used, z2.f90 without f compiles. Changed between 20161218 and 20170108. $ cat z1.f90 program p real, target :: a = 1.0 type t real, pointer :: q end type type(t) :: z[*] z%q => a contains function f(x) type(t), intent(in) :: x end end $ cat z2.f90 program p real, target :: a = 1.0 type t real, pointer :: q end type type(t) :: z[*] z%q => a end $ gfortran-7-20161218 -c z1.f90 -fcoarray=lib $ $ gfortran-8-20180204 -c z1.f90 -fcoarray=lib z1.f90:11:0: end internal compiler error: Segmentation fault 0xb953ff crash_signal ../../gcc/toplev.c:325 0xdca5d4 recompute_tree_invariant_for_addr_expr(tree_node*) ../../gcc/tree.c:4535 0xdca8c1 build1(tree_code, tree_node*, tree_node*) ../../gcc/tree.c:4635 0x92233c build1_loc ../../gcc/tree.h:4102 0x92233c fold_build1_loc(unsigned int, tree_code, tree_node*, tree_node*) ../../gcc/fold-const.c:12284 0x7497af gfc_build_addr_expr(tree_node*, tree_node*) ../../gcc/fortran/trans.c:298 0x75d208 structure_alloc_comps ../../gcc/fortran/trans-array.c:8782 0x76588e generate_coarray_sym_init ../../gcc/fortran/trans-decl.c:5369 0x7341cb do_traverse_symtree ../../gcc/fortran/symbol.c:4157 0x764a45 generate_coarray_init ../../gcc/fortran/trans-decl.c:5410 0x770bfc gfc_generate_function_code(gfc_namespace*) ../../gcc/fortran/trans-decl.c:6428 0x700040 translate_all_program_units ../../gcc/fortran/parse.c:6121 0x700040 gfc_parse_file() ../../gcc/fortran/parse.c:6324 0x74686f gfc_be_parse_file ../../gcc/fortran/f95-lang.c:204