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

/Qfp-stack-check

gib
New Contributor II
576 Views
The following program is fine when compiled (on Windows) with
ifort err.f90
but when compiled with the fp stack checking option
ifort /Qfp-stack-check err.f90
it gives access violation when executed.

In my debugging efforts I've been turning on all the stack checking options, but this one seems to create a bug itself.
Interestingly, commenting out either of the two executable statements in subroutine zzz makes it OK.
Any comments Steve?

cheers
Gib

! err.f90
module errmod
implicit none
contains
subroutine zzz(m)
integer :: m(3)
integer :: n(3)
real :: x(3)

x = m
n = x

end subroutine
end module

program err
use errmod
integer :: site(3) = (/1,2,3/)
call zzz(site)
end

0 Kudos
5 Replies
Les_Neilson
Valued Contributor II
576 Views

The option is /Qfpstkchk

I tried your code both from the command line and within VS without a problem
(VS2005 and IVF 9.1.028)

Les

0 Kudos
Steven_L_Intel1
Employee
576 Views
Access violation is exactly what to expect when the FP stack check option finds a problem.

I can reproduce the error - let me investigate.
0 Kudos
Steven_L_Intel1
Employee
576 Views
By the way, the correct spelling of the option in version 10.1 is /Qfp-stack-check. The older spelling /Qfpstkchk has been deprecated. I don't see the error with 9.1 nor with the internal build of our next major release (still a ways away).

As best as I can tell, this is a compiler bug. It occurs only with optimization level 2 or 3. I have reported this to development. If you report the issue to Intel Support, please reference T85092-CP.
0 Kudos
gib
New Contributor II
576 Views
Thanks Steve.
0 Kudos
Steven_L_Intel1
Employee
576 Views
The problem you encountered was reported earlier and is fixed in our next major release. A workaround is to use /QxN or whatever other appropriate version of /Qx is that would generate SSE code instead of x87 (no FP stack, runs faster.) Reference: T80134-CP.
0 Kudos
Reply