Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

ifort optimization bug?

kambrian
Beginner
459 Views
the following code runs erroneous when compiled with ifort 10.1-ia64 without specifying any compiler options:
[cpp]program testdo
implicit none

integer*4:: np,i,j
real*4,allocatable::arr(:,:)

np=1024*1024*1024;
allocate(arr(np,3))
forall(i=1:np,j=1:3)
arr(i,j)=i+0.1*j
end forall
write(*,*)  arr(1,1:3)
write(*,*) (arr(1,j),j=1,3)  ! seems to print arr(1,1) three times?

end program testdo[/cpp]

the result reads:
1.100000 1.200000 1.300000
1.100000 1.100000 1.100000
While using gfortran or using ifort -O0 -g, it runs correctly to print:
1.100000 1.200000 1.300000
1.100000 1.200000 1.300000
0 Kudos
1 Reply
Yuan_C_Intel
Employee
459 Views


Kambrian,

This problem has already been fixed in the 10.1.022compiler or 11.0 compiler. Please try this new version andreply tous if you have additional questions. You may download the latestpackagefrom our Registration Center: https://registrationcenter.intel.com/.

Yolanda Chen
Intel Developer Support
Tools Knowledge Base: http://software.intel.com/en-us/articles/tools

0 Kudos
Reply