Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28633 Discussions

Compiler bug: ifort 10.1 20070913 vectorization may break fused loops in -fPIC / 64bit mode.

knizia
Beginner
401 Views
Hello,
I encountered what I consider a compiler bug. Unfortunatelly, during the past 30min I was not able to get "premier support" to work or find some other way of submitting this issue more directly.

Concretely:
The following file
-- bug.f90 --
module dummy_mod

contains

subroutine dummyfn(nOcc)
integer, intent(in) ::&
nOcc
integer ::&
DiagonalPairs(2, nOcc)

DiagonalPairs(1,:) = (/ (i, i = 1, nOcc) /)
DiagonalPairs(2,:) = DiagonalPairs(1,:)
! ^- second statement produces broken results on ifort
! 10.1 20070913 if compiled with -fPIC -i8 -O3 bug.f90

do i = 1, nOcc
print *, DiagonalPairs(1,i), DiagonalPairs(2,i)
end do
end subroutine

end module


program broken_array_assign
use dummy_mod
call dummyfn(5)
end program
-- eof --

does as expected if compiled with "ifort -fPIC -i8 -O0 bug.f90", but breaks if compiled with "ifort -fPIC -i8 -O3 bug.f90":

~/tmp/ifort10.1-bug> run.sh
with 'ifort -fPIC -i8 -O0 bug.f90':
1 1
2 2
3 3
4 4
5 5
with 'ifort -fPIC -i8 -O3 bug.f90':
bug.f90(11): (col. 4) remark: FUSED LOOP WAS VECTORIZED.
1 0
2 0
3 72105053915740032
4 47459878089888
&n bsp; 5 5
note: this does not happen without the -fPIC or in 32bit mode.
~/tmp/ifort10.1-bug>

I'd appreciate it if someone from Intel reading this forum would forward this to the suitable compiler developers, as I can't do it.
0 Kudos
3 Replies
Steven_L_Intel1
Employee
401 Views
What specifically goes wrong when you try to submit through Intel Premier Support?
0 Kudos
Steven_L_Intel1
Employee
401 Views
This has been confirmed as a bug and passed on to the developers. The reference number is Q462218.
0 Kudos
rebecoco
Beginner
401 Views
So they fix it?
___________
Texas holdem
0 Kudos
Reply