On 10/11/2013 21:55, Jonas Maebe wrote:
On 10 Nov 2013, at 22:42, Martin wrote:

Why is the
movl    %eax,-12(%ebp)
generated at the start of i:=i+1

Why does a statement save an outdated value to memory?
Because the load back from memory that came right after it got removed by a 
peephole optimisation. Peephole optimisations are by definition local and have 
no clue about what happens next, and hence the store remains.


Ok, i understand, but that would mean hat the save originally was intended for the "i := 1" statement.

So somewhere in that process, the debug info, and the statements get out of sync.

I only wonder, if despite the fact that O1 does not guarantee, if in this case it would be worth to consider it a bug (and intend to fix it)?

Because a lot of users rely on O1 being good for the debugger, and not everyone might spot such a value as wrong by the debugger. So people may spent a long time to figure out why there code does something, that it actually does not do.



_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to