Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Important Update: Community Platform Migration​. Learn more​>

Strange behvavior in debug session

dannycat
New Contributor I
1,574 Views
I encountered a strange problem when debuggging some code whereby the value of avarible didn't change even though it should. This only occurs in the 64 bit configuration, as the 32-bit seems fine.

eg

integer :: idx
integer :: i
integer :: n(100)

n = 0
idx = 0
do i = 1 , 100
if(mod(i,10).eq.0) cycle
idx = idx + 1
no(i) = 1
enddo

The above example reconstructs the section of code I am referring to (i.e. it isn't the exact code). When, in my code, I step over the idx = idx + 1 line the value of idx, in theWatch window does not change, and the program terminatesat the next line (out of bounds error).

Has anyone got any ideas what causes this type of behaviour or how to track in down? I have changed the name of idx to something else (just in case it had the same name as a publicmodulevariable but it had no effect.

I tried Cleaning and rebuilding the whole program but this does not solve the problem.

I'm thinking that it must be a memory overwrite somewhereas I believe itis not caused by the optimisation as none is enabled in debug mode.

Thanks

Steve
0 Kudos
1 Reply
mecej4
Honored Contributor III
1,574 Views
If compiler optimization has not been turned off, the debugger will find it hard to correlate the program counter with the source code line number. It is even possible to see the active line decrease in a segment of code where it should not since there are no branch type statements.
0 Kudos
Reply