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

bug or feature of loop optimizations ?

aradzh07
Beginner
614 Views
When I try to compile code with two loops it behavior depend on target platform, i.e. release version for x64 lead to wrong answer or even NaN. For Win32 all is ok. Eventually uncommenting line with write operator lead to correct answer.
(Please find attached file with UnA function - I try to put code directly to this post but it is shown incorrectly :( )
...
!----------------------------------------------
res1 = UnA(0.1d0,0.0d0)
! answer should be 0.787914997424541
print *,res1
...
0 Kudos
4 Replies
Steven_L_Intel1
Employee
614 Views
Can you attach a test program that uses this function and demonstrates the problem?
0 Kudos
TimP
Honored Contributor III
614 Views
$ ifort -Qdiag-enable:sv3 UnA.f90
Intel Visual Fortran Compiler for applications running on IA-32, Version 10.1
Build 20071116 Package ID: w_fc_p_10.1.013
Copyright (C) 1985-2007 Intel Corporation. All rights reserved.

c:src etUnA.f90(15): error #12143: [SV] "SM" is uninitialized
0 Kudos
aradzh07
Beginner
614 Views
Please find attached simple program (UnA.f90 already included). The result for win32 is normal whereas for x64 it prints NaN. (I also try it with linux version of 64-bit ifc and result is also NaN).
Initialization of sm,pointed out by tim, do not cure this problem.
0 Kudos
Steven_L_Intel1
Employee
614 Views
I can reproduce the problem. Please submit a report to Intel Premier Support and attach your test case.
0 Kudos
Reply