Silverfrost Forums

Welcome to our forums

Correct code rejected by compiler with /64 /opt

31 Mar 2024 11:14 #31299

The following code contains a subroutine with a 1-dimensional array argument whose name is the same as that of an intrinsic function, INT.

subroutine elmhes(Nm,N,Low,Igh,A,Int)
   implicit none
   integer Igh, Low, N, Nm, i, j, m, mm1, Int(*)
   real A(Nm,*), x, y
!
   do m = Low + 1, Igh - 1
      mm1 = m - 1
      x = 0.0E0
      i = m
      Int(m) = i
      if ( x == 0.0E0 ) cycle
!
      do i = m+1, Igh
         y = A(i,mm1)
         if ( y /= 0.0E0 ) then
            y = y/x
            A(i,mm1) = y
            do j = m, N
               A(i,j) = A(i,j) - y*A(m,j)
            end do
            do j = 1, Igh
               A(j,m) = A(j,m) + y*A(j,i)
            end do
         end if
      end do
   end do
   return
end subroutine elmhes

When the 9.02 compiler is given this code and the options /64 /opt are specified, a false syntax error report is issued:

S:\ALGO\SLATEC\src>ftn95 /64 /opt elm.f90
[FTN95/x64 Ver. 9.02.0.0 Copyright (c) Silverfrost Ltd 1993-2024]
ERROR S:\ALGO\SLATEC\src\elm.F90 22:  Array INT appears in this expression as rank 2, but was declared as rank 1
    1 ERROR  [<ELMHES> FTN95 v9.02.0.0]
*** Compilation failed

Please note that the symbol Int does not appear after line 10 of the source file.

1 Apr 2024 8:09 #31300

mecej4

Many thanks for the bug report. It relates to optimisation number 40.

1 Apr 2024 3:06 #31301

This failure has now been fixed for the next release of FTN95.

It turned out that the failure related to optimisation number 95.

Please login to reply.