https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68566
--- Comment #11 from Gerhard Steinmetz <gerhard.steinmetz.fort...@t-online.de> --- Another constellation (appearing legal) : $ cat zz1.f90 program p integer :: n(2) = [2,1] print *, reshape ([1,2,3,4,5,6], [2,4], [0,0], [2,1]) print *, reshape ([1,2,3,4,5,6], [2,4], [0,0], n) print *, reshape ([1,2,3,4,5,6], [2,4], [0,0], [n]) end $ gfortran-6 zz1.f90 f951: internal compiler error: Segmentation fault $ gfortran-7-20160626 zz1.f90 f951: internal compiler error: Segmentation fault 0xc0bdff crash_signal ../../gcc/toplev.c:335 0x66230e gfc_check_reshape(gfc_expr*, gfc_expr*, gfc_expr*, gfc_expr*) ../../gcc/fortran/check.c:3848 0x6949a4 check_specific ../../gcc/fortran/intrinsic.c:4274 0x69dd84 gfc_intrinsic_func_interface(gfc_expr*, int) ../../gcc/fortran/intrinsic.c:4489 0x6e27c6 resolve_unknown_f ../../gcc/fortran/resolve.c:2718 0x6e27c6 resolve_function ../../gcc/fortran/resolve.c:3020 0x6e27c6 gfc_resolve_expr(gfc_expr*) ../../gcc/fortran/resolve.c:6353 0x6e7241 gfc_resolve_code(gfc_code*, gfc_namespace*) ../../gcc/fortran/resolve.c:10446 0x6e6f9b gfc_resolve_blocks(gfc_code*, gfc_namespace*) ../../gcc/fortran/resolve.c:9497 0x6e734e gfc_resolve_code(gfc_code*, gfc_namespace*) ../../gcc/fortran/resolve.c:10436 0x6e9a22 resolve_codes ../../gcc/fortran/resolve.c:15644 0x6e9b11 gfc_resolve(gfc_namespace*) ../../gcc/fortran/resolve.c:15678 0x6d4fea resolve_all_program_units ../../gcc/fortran/parse.c:5782 0x6d4fea gfc_parse_file() ../../gcc/fortran/parse.c:6034 0x717692 gfc_be_parse_file ../../gcc/fortran/f95-lang.c:201 # (configured with --enable-checking=yes) --- $ cat zz2.f90 program p integer, allocatable :: n(:) n = [2,1] print *, reshape ([1,2,3,4,5,6], [2,4], [0,0], [2,1]) print *, reshape ([1,2,3,4,5,6], [2,4], [0,0], n) print *, reshape ([1,2,3,4,5,6], [2,4], [0,0], [n]) end $ gfortran-6 zz2.f90 *** Error in `/usr/lib64/gcc/x86_64-suse-linux/6/f951': double free or corruption (fasttop): 0x000000000232c4c0 *** #... f951: internal compiler error: Aborted