Mysterious crashes, slow convergence and incorrect results were observed when a large program was compiled with /64 and run. This behaviour occurred with /64, /64 /opt and /64 /check, but not with /64 /checkmate, nor with any 32 bit run. I am using FTN95 V 8.51
The following short subroutine demonstrates the problem. It is, of necessity, not ready to run, but compiling and observing the /exp listing shows the problem.
MODULE mcm
IMPLICIT NONE
INTEGER, PARAMETER :: kdp = SELECTED_REAL_KIND(14,60)
REAL(KIND=kdp), DIMENSION(:), ALLOCATABLE, TARGET :: rhs
INTEGER :: nbn
REAL(KIND=kdp) :: epsslv
INTEGER, PARAMETER :: lrcgd1=19
END MODULE mcm
SUBROUTINE gcgris(ra,xx)
USE mcm
IMPLICIT NONE
REAL(KIND=kdp), DIMENSION(:,:), INTENT(INOUT) :: ra
REAL(KIND=kdp), DIMENSION(:), INTENT(INOUT), TARGET :: xx
!
INTEGER :: i, j
REAL(KIND=kdp) :: r00
!
!...... code to calculate array rhs(), removed for this reproducer
!
r00 = SQRT(DOT_PRODUCT(rhs,rhs))
xx = 0._kdp
IF (r00 <= epsslv) RETURN
DO i=1,nbn
DO j=1,lrcgd1
ra(j,i) = 0.0_kdp
END DO
END DO
END SUBROUTINE gcgris
If you compile this code with /64 /exp, you will see the following call in the code listing:
R:\lang\FTN95\tbed>grep -i dot gcg.lis
0019 r00 = SQRT(DOT_PRODUCT(rhs,rhs)) AT 1fb
0000025c(#78,117,10): CALL __dotp4
The routine being called is for evaluating the DOT_PRODUCT of two single precision arrays. The correct routine to call for double precision arrays is __dotp8.
The bug does not occur with /64 /checkmate or 32-bit compilations because in those cases the code for evaluating the scalar product is generated inline. Nor does the bug occur with /64 when the code contains the scalar product calculation of just local arrays.