https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102521
Bug ID: 102521 Summary: ICE in gfc_conv_array_initializer, at fortran/trans-array.c:6240 Product: gcc Version: 12.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 at least r5 : (should print 1 1 1 1) $ cat z1.f90 program p type t integer :: n end type type(t), parameter :: a(4) = t(1) type(t), parameter :: b(2,2) = reshape(a, [2,2]) print *, b end $ gfortran-12-20210926 -c z1.f90 z1.f90:7:13: 7 | print *, b | 1 internal compiler error: in gfc_conv_array_initializer, at fortran/trans-array.c:6240 0x85f8ea gfc_conv_array_initializer(tree_node*, gfc_expr*) ../../gcc/fortran/trans-array.c:6240 0x88a250 gfc_conv_initializer(gfc_expr*, gfc_typespec*, tree_node*, bool, bool, bool) ../../gcc/fortran/trans-expr.c:8014 0x86c70f gfc_get_symbol_decl(gfc_symbol*) ../../gcc/fortran/trans-decl.c:1940 0x87be08 gfc_conv_variable ../../gcc/fortran/trans-expr.c:2994 0x877faa gfc_conv_expr(gfc_se*, gfc_expr*) ../../gcc/fortran/trans-expr.c:9041 0x87ae20 gfc_conv_expr_lhs(gfc_se*, gfc_expr*) ../../gcc/fortran/trans-expr.c:9071 0x84dcb8 gfc_conv_ss_descriptor ../../gcc/fortran/trans-array.c:3087 0x850560 gfc_conv_ss_startstride(gfc_loopinfo*) ../../gcc/fortran/trans-array.c:4417 0x8a9245 gfc_trans_transfer(gfc_code*) ../../gcc/fortran/trans-io.c:2645 0x849d57 trans_code ../../gcc/fortran/trans.c:2138 0x8a6bde build_dt ../../gcc/fortran/trans-io.c:2026 0x849d37 trans_code ../../gcc/fortran/trans.c:2110 0x870394 gfc_generate_function_code(gfc_namespace*) ../../gcc/fortran/trans-decl.c:6919 0x7f6646 translate_all_program_units ../../gcc/fortran/parse.c:6572 0x7f6646 gfc_parse_file() ../../gcc/fortran/parse.c:6841 0x842daf gfc_be_parse_file ../../gcc/fortran/f95-lang.c:216