Strange effect in debug step mode

Strange effect in debug step mode

I detect a strange effect when debugging a Fortran program (Free format).
I can reproduce the problem in the following very small program:

program test
integer ia
ia = 1
print *, ia
end

When I set a breakpoint on the statement "ia = 1", run it in debug mode
and do a step in debug mode, it appeared that the value of ia is 0 instead of 1.
When I replace the variable "ia" by any other name, the value in step
mode is 1, as expected.
When you run the (debug compiled) program via "Execute test.exe" the
printed value is properly 1.

What is so special about the variable "ia" in debug step mode?

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.