1! { dg-do run } 2! PR46842 wrong results with MATMUL(..., TRANSPOSE (func ())) 3implicit none 4call sub() 5contains 6 subroutine sub() 7 real, dimension(2,2) :: b 8 b = 1.0 9 b = matmul(b,transpose(func())) 10 if (any(b.ne.reshape((/ 4.0, 4.0, 6.0, 6.0 /),[2,2]) )) print *, b 11 end subroutine 12 13 function func() result(res) 14 real, dimension(2,2) :: res 15 res = reshape([1,2,3,4], [2,2]) 16 end function 17end 18