When the options /64 and /opt are used to compile code containing invocations of the Fortran intrinsic DOT_PRODUCT, FTN95 V9.0 may generate calls to its RTL function DOT_PRODUCT8@ or it may generate a loop inline for the same purpose. I suspect that in the former case it is not passing the correct arguments to DOT_PRODUCT8@, or the RTL function itself may contain a bug. The user may see the result as zero or an access violation may occur in CLEARWIN64.DLL.
Here is a demonstrator:
program dotbug
implicit none
integer, parameter :: kdp = kind(0.0d0)
real(kind=kdp), dimension(:,:), allocatable :: ap
integer nbn, l, nn, i
nbn = 6479
l = 0
allocate (ap(1:nbn, 0:l))
do i = 1, nbn
ap(i,l) = 2.1d0*i-1.4d0
end do
call ssq(nbn,ap)
end program
subroutine ssq(nbn,ap)
implicit none
integer, parameter :: kdp = kind(0.0d0), nsdr = 1
integer, intent(in out) :: nbn
real(kind=kdp), dimension(nbn,0:*), intent(in out) :: ap
!
integer :: l
real(kind=kdp), dimension(0:nsdr-1) :: delta
!
l = 0
! The next line may result in a call to the FTN95 library function dot_product8@,
! depending on the compiler options used in addition to /64
delta(l) = dot_product(ap(1:nbn,l),ap(1:nbn,l))
print '(1x,A,i2,i5,es12.2)','SSQ: l,nbn,delta(l) = ',l,nbn,delta(l)
stop
end subroutine ssq
When this code is compiled with /64 and run, the output is
SSQ: l,nbn,delta(l) = 0 6479 4.00E+11
If I use /64 /opt and run, an access violation occurs in the routine DOT_PRODUCT8$ (at address 60) within CLEARWIN64.DLL.