https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71961
--- Comment #11 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> --- This even gives wrong results at -O0 ... > cat test.f90 INTEGER, DIMENSION(:,:), POINTER :: a INTEGER, DIMENSION(:,:), ALLOCATABLE :: b ALLOCATE(a(4,4),b(4,2)) a=1 ; b=2 a(:,1:2)=MATMUL(a(:,1:4),b(:,:)) write(6,*) a IF (ANY(a.NE.RESHAPE((/8,8,8,8,8,8,8,8,1,1,1,1,1,1,1,1/),(/4,4/)))) & CALL ABORT END gives correct results with gcc 5.3