[fpc-devel] bug: Inc(v,i)/Dec(v,i)

Marcel Martin mm10 at ellipsa.net
Thu Jul 7 02:24:22 CEST 2005


peter green a écrit :
> shouldn't it implement inv(v,-1) in exactly the same way it implements
> v:=v-1?

Well, I am far to be an expert in compilers but I think no,
it shouldn't.
v := v + Longword(-1) is different from v := v - Longword(1).
The resulting value v is the same but not the way to get it.
If, as a programmer, I write 'Inc', the compiler should code
an addition and not a subtraction.

mm





More information about the fpc-devel mailing list