The test code below, when compiled with /64 /check /inhibit_check 6, aborts with a strange error report.
The program:
program negcountarg
implicit none
real, external :: dumach
real uround
uround = dumach()
print *,'Uround = ',uround
end program
real function dumach ()
implicit none
real :: u, comp
u = 1.0
u = u*0.5
call dumsum (1.0, u, comp)
do while(comp /= 1.0)
u = u*0.5
call dumsum (1.0, u, comp)
end do
dumach = u*2.0
return
end function dumach
subroutine dumsum(a, b, c)
implicit none
real, intent(in) :: a, b
real, intent(out) :: c
c = a + b
return
end subroutine dumsum
Compile and link:
ftn95 /64 /check bug.f90 /inhibit_check 6 /link
Running the program produces the following error:
Silverfrost 64-bit exception report on T:\ODEPACK\splt1\ncom\v90\tbed\BUG\bug.exe Thu Nov 10 19:50:53 2022
Attempt to call a routine with minus one arguments when three were required at address 1a0093e9
Within file bug.exe
in DUMSUM at address 145
in DUMACH in line 21, at address 119
in NEGCOUNTARG in line 6, at address 3d
Obviously, something went wrong in counting the number of actual arguments for the compiler options used.
The bug does not occur for 32-bit runs, in my limited experience.