We have see in the past some examples of source code given which FTN95 /64 runs into an 'AMD backend failure'. Here is another example, which is fairly short and contains only one line with a matrix expression using user defined matrix multiply and matrix-transpose multiply operators.
The code compiles fine with FTN95 8.51, 32-bit, and other compilers such as Gfortran. FTN95 8.51 fails with /64.
*** AMD backend failure:Failed to do memory-register emit for MOVSS at 754
The source code:
module linear_oper
implicit none
interface operator(.x.)
module procedure MultAB, MultAv
end interface
interface operator(.tx.)
module procedure MultATB, MultATv
end interface
interface
subroutine gemv(A,b,v,trans)
real :: A(:,:), b(:), v(:)
character(1), optional :: trans
end subroutine
subroutine gemm(A,B,C,transa)
real :: A(:,:), B(:,:), C(:,:)
character(1), optional :: transa
end subroutine
end interface
contains
function MultAB(a, b)
real, dimension(:,:), intent(in) :: a,b
real, dimension(size(a,1),size(b,2)) :: MultAB
call gemm(a,b, MultAB)
end function MultAB
function MultAv(a, b)
real, dimension(:,:), intent(in) :: a
real, dimension(:), intent(in) :: b
real, dimension(size(a,1)) :: MultAv
call gemv(a,b, MultAv)
end function MultAv
function MultATB(a, b)
real, dimension(:,:), intent(in) :: a,b
real, dimension(size(a,2),size(b,2)) :: MultATB
call gemm(a,b, MultATB, transa='T')
end function MultATB
function MultATv(a, b)
real, dimension(:,:), intent(in) :: a
real, dimension(:), intent(in) :: b
real, dimension(size(a,2)) :: MultATv
call gemv(a,b, MultATv,trans='T')
end function MultATv
end module linear_oper
subroutine tor_modal_dec(eigvec,mtt,mmt,n)
use linear_oper
implicit none
integer :: n
real :: mtt(n,n), mmt(n,n), eigvec(n,n)
mmt(:,:) = eigvec(:,1:n) .tx. mtt .x. eigvec(:,1:n)
end subroutine tor_modal_dec