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

Differences found in executable from code compiled with v11.1 and v12.0

Gerald_Duff
Beginner
562 Views
I have moved to XE composer 2011 and found out that the results from my code are differents from the one computed with v11.1


The problem comes from the new compiler optimization :

v11.1, no optimization : OK
v11.1, /O3 : OK
v11.1, no optimization : OK
V12.0, /O3 : Wrong

The involved loop is the one below, a "write" statement correct the problem.

do ispeed=1,nspeed
if (ispeed == num_speed_temp(inss,iroute)) then
prob_speed(ispeed, inss,iroute)= prob_speed(ispeed, inss,iroute) + a
!write(*,*) !necessary to get correct results
end if
end do


Anyone knows how to avoid such error and still benefit of some optimization for the other part of the code ?
0 Kudos
2 Replies
Steven_L_Intel1
Employee
562 Views
We would need to see the actual program and be able to compile and run it to comment. Often a problem that "goes away" when a WRITE is added is caused by a reference to uninitialized memory. The actual error can be unrelated to the code you added.
0 Kudos
Gerald_Duff
Beginner
562 Views
Thanks for the answer, it certainly had something to do with uninitialized memroy, changing a fixed size array into an allocatable array have solved the problem.
0 Kudos
Reply