https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85002
Bug ID: 85002 Summary: [7/8 Regression] ICE in fold_ternary_loc, at fold-const.c:11360 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: --- Changed between 20161127 and 20161204. Needs option -fcoarray=single or -fcoarray=lib. $ cat z1.f90 program p type t integer, allocatable :: a(:) end type type t2 type(t), allocatable :: b(:) end type type(t) :: x type(t2) :: y(2)[*] allocate (x%a(2)) x%a = 123 y = t2([x]) end $ gfortran-7-20161127 -c z1.f90 -fcoarray=single $ gfortran-7-20161127 -c z1.f90 -fcoarray=lib $ $ gfortran-8-20180318 -c z1.f90 -fcoarray=single z1.f90:12:0: y = t2([x]) internal compiler error: Segmentation fault 0xb9bd5f crash_signal ../../gcc/toplev.c:325 0x91b998 fold_ternary_loc(unsigned int, tree_code, tree_node*, tree_node*, tree_node*, tree_node*) ../../gcc/fold-const.c:11360 0x91d323 fold_build3_loc(unsigned int, tree_code, tree_node*, tree_node*, tree_node*, tree_node*) ../../gcc/fold-const.c:12388 0x75d91a structure_alloc_comps ../../gcc/fortran/trans-array.c:8848 0x75d510 structure_alloc_comps ../../gcc/fortran/trans-array.c:8403 0x75d9b5 structure_alloc_comps ../../gcc/fortran/trans-array.c:8955 0x777a91 gfc_trans_scalar_assign(gfc_se*, gfc_se*, gfc_typespec, bool, bool, bool) ../../gcc/fortran/trans-expr.c:8936 0x7861f9 gfc_trans_assignment_1 ../../gcc/fortran/trans-expr.c:10260 0x74a3b7 trans_code ../../gcc/fortran/trans.c:1828 0x7716b9 gfc_generate_function_code(gfc_namespace*) ../../gcc/fortran/trans-decl.c:6507 0x7009c0 translate_all_program_units ../../gcc/fortran/parse.c:6121 0x7009c0 gfc_parse_file() ../../gcc/fortran/parse.c:6324 0x74755f gfc_be_parse_file ../../gcc/fortran/f95-lang.c:204