Due to INTEGER datatype of the constant and the variable changed to UINTEGER the conditionnal jump (asm instruction) after the comparison is using the unsigned one instead the signed one.
Problem with gcc64 and also gas64.
dim as longint v1=-2147483649
if v1<=4294967295 then
print "v1<="
End If
if v1<4294967296 then
print "v1<"
End If
V1$0 = -2147483649ll;
// if v1<=4294967295 then
if( (uint64)V1$0 > 4294967295ull) goto label$3;
// if v12<4294967296 then
if( V12$0 >= 4294967296ll) goto label$5;
In the third part of code the variable name is well V1 not V12.
Some additional information and notes:
-w signedness
will warn of this situation.ll
should ensure the constant is seen as signedFor comparison:
On 32-bit we get other warnings because constant is seen as unsigned 32-bit and the negative is not parsed as part of the constant - so is negating an unsigned literal
On 64-bit we get the bad comparison due to mixing signed and unsigned operands: