https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106857
Bug ID: 106857 Summary: [10/11/12/13 Regression] ICE in gfc_simplify_pack, at fortran/simplify.cc:6438 Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: gs...@t-online.de Target Milestone: --- Started between 20211003 and 20211010 : $ cat z1.f90 program p type t integer :: n end type type(t), parameter :: a(2,2) = t(1) type(t), parameter :: b(4) = reshape(a, [2]) type(t), parameter :: c(2) = pack(b, [.false.,.true.,.false.,.true.]) end $ gfortran-12-20211003 -c z1.f90 z1.f90:6:29: 6 | type(t), parameter :: b(4) = reshape(a, [2]) | 1 Error: Different shape for array assignment at (1) on dimension 1 (4 and 2) $ gfortran-13-20220904 -c z1.f90 f951: internal compiler error: Segmentation fault 0xd8a29f crash_signal ../../gcc/toplev.cc:314 0x84695d gfc_simplify_pack(gfc_expr*, gfc_expr*, gfc_expr*) ../../gcc/fortran/simplify.cc:6438 0x7c2f2a do_simplify ../../gcc/fortran/intrinsic.cc:4677 0x7cde0a gfc_intrinsic_func_interface(gfc_expr*, int) ../../gcc/fortran/intrinsic.cc:5056 0x8230c8 resolve_unknown_f ../../gcc/fortran/resolve.cc:2990 0x8230c8 resolve_function ../../gcc/fortran/resolve.cc:3347 0x8230c8 gfc_resolve_expr(gfc_expr*) ../../gcc/fortran/resolve.cc:7194 0x7b2de4 gfc_reduce_init_expr(gfc_expr*) ../../gcc/fortran/expr.cc:3163 0x7b5d70 gfc_match_init_expr(gfc_expr**) ../../gcc/fortran/expr.cc:3211 0x79ff6b variable_decl ../../gcc/fortran/decl.cc:3028 0x79ff6b gfc_match_data_decl() ../../gcc/fortran/decl.cc:6331 0x80b513 match_word ../../gcc/fortran/parse.cc:67 0x80b513 decode_statement ../../gcc/fortran/parse.cc:378 0x80cf5a next_free ../../gcc/fortran/parse.cc:1398 0x80cf5a next_statement ../../gcc/fortran/parse.cc:1630 0x80e4fb parse_spec ../../gcc/fortran/parse.cc:4169 0x8116bc parse_progunit ../../gcc/fortran/parse.cc:6211 0x812d81 gfc_parse_file() ../../gcc/fortran/parse.cc:6756 0x860b1f gfc_be_parse_file ../../gcc/fortran/f95-lang.cc:229