The bugs reported here are akin to those that I recently reported in the thread https://forums.silverfrost.com/Forum/Topic/3462 . Here, I have a drastically simplified and short example code, and am able to shed some light on what the generated code is actually doing, as opposed to what it should have done.
The example source code:
program xpi
implicit none
integer, parameter :: nx = 2
integer :: i, n = nx*4
real :: x(4*nx) = (/ (1.0, 2.0, 3.0, 4.0, i=1,nx) /)
real :: s
s = sum((x(2:n-2:2)-x(3:n-1:2))**4)
print *,s,' (expected: 83)'
end
The results that I obtained from FTN95 8.30.279:
-default- 26.3333
/opt 26.3333
/check Internal compiler error
/checkmate Internal compiler error
/64 21.0000
/64 /opt 21.0000
/64 /check 0.0000
/64 /checkmate 0.0000
Inspection of the /exp listings for some of the cases (where there is output and that output is not zero) shows that the 32-bit EXE actually computes sum((u-v)*3/v), and the 64-bit EXE actually computes sum(v(u-v)**3), where
u = x(2:n-2:2)
and v = x(3:n-1:2), instead of computing the requested result sum((u-v)**4)