[fpc-devel] probably incorrect debug-line-info generated by fpc 2.6.2 and trunk

Martin lazarus at mfriebe.de
Sun Nov 10 23:05:08 CET 2013


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.






More information about the fpc-devel mailing list