Hello,
we are frustrating with a weird problem caused by the latest Intel's compiler suites (ifort/icc v14.0.2.144, Linux x86_64/EM64T). Depending on the optimization level, the following code generates different results:
CSTART
subroutine MakeWwdHlp2 (Ww,W1,dima,dimbe,dimga)
implicit none
integer dima,dimb,dimab,dimbe,dimga,key
real*8 Ww(1:dima,1:dimbe,1:dimga)
real*8 W1(1:dima,1:dimbe,1:dima,1:dimga)
integer a,be,ga
do ga=1,dimga
do be=1,dimbe
do a=1,dima
Ww(a,be,ga)=W1(a,be,a,ga)
end do
end do
end do
C Uncomment to get correct results/loop's counters
c print *,ga,be,a
return
end
CEND
The '-O0' as well as '-O1' optimization levels give us correct results while '-O2' doesn't. If the printing line is uncommented then results become always correct, regardless the optimization level used. The 'dimga','dima', and 'dimbe' counters are in the range [10,12]. Enclosed please find the assembler listing generated via '-00','-O1', and '-O2'.
It would be great to identify the compler's option that causes the problem.
Thank in advance!
Victor.