This is a simplified version of a bug reported by AntonioGJerez in http://forums.silverfrost.com/viewtopic.php?p=18250#18250 . FTN95 7.10 gives wrong results when MATMUL is invoked with a single-precision complex argument and a double-precision real argument. Here is an example in which MATMUL is used to evaluate the outer product of vectors B and C, where B is represented as a 2 X 1 double-precision matrix and C as a 1 X 2 single-precision complex matrix. The bug does not occur if B is made single-precision.
program MatmulBug
implicit none
double precision B(2,1)
complex C(1,2)
!
B=dble(reshape((/1.,2./),(/2,1/)))
C=cmplx(reshape((/1.,3./),(/1,2/)))
!
write(*,*)'B = ',B
write(*,*)'C = ',C
write(*,*)'B X C = ',matmul(B,C)
end program
FTN95 gives the product as (in usual Fortran 2-D array order) [(0,1.875), (0,3.75), (0,2.125), (0,4.25)], instead of the correct result, [(1,0), (2,0), (3,0), (6,0)].
[P.S., 15 June 2015: This bug is also present in FTN95-7.20]