https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85631
--- Comment #2 from Thomas Koenig <tkoenig at gcc dot gnu.org> --- The matmul inlining is only exposing a bug in reshape with allocatable variables. This also fails: $ cat a.f90 implicit none integer, parameter :: N=2 real, dimension(:,:), allocatable :: block_1 real, allocatable, dimension(:,:) :: var_1_mma allocate(block_1(N,N)) block_1 = reshape([-2,3,-5,7], [2,2]) var_1_mma = transpose(block_1) print *,var_1_mma end program $ gfortran -fcheck=bounds a.f90 $ ./a.out At line 9 of file a.f90 Fortran runtime error: Array bound mismatch for dimension 1 of array 'var_1_mma' (140020497252353/2) Error termination. Backtrace: #0 0x400f95 in ??? #1 0x401445 in ??? #2 0x7f59b6c8d724 in ??? #3 0x4007f8 in ??? at ../sysdeps/x86_64/start.S:118 #4 0xffffffffffffffff in ???