mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-21 11:29:22 +02:00
Change AVOID_OVERFLOW to avoid warning about inequality being always true
This commit is contained in:
parent
b521ac967f
commit
acf5675a90
@ -70,7 +70,7 @@ unit cgcpu;
|
|||||||
{$ifopt Q+}
|
{$ifopt Q+}
|
||||||
{$define AVOID_OVERFLOW}
|
{$define AVOID_OVERFLOW}
|
||||||
const
|
const
|
||||||
low_value = low(longint);
|
max_12_bit = 1 shl 12;
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
{ Range check must be disabled explicitly as conversions between signed and unsigned
|
{ Range check must be disabled explicitly as conversions between signed and unsigned
|
||||||
@ -479,7 +479,7 @@ unit cgcpu;
|
|||||||
tmplo:=cg.GetIntRegister(list,OS_32);
|
tmplo:=cg.GetIntRegister(list,OS_32);
|
||||||
carry:=cg.GetIntRegister(list,OS_32);
|
carry:=cg.GetIntRegister(list,OS_32);
|
||||||
|
|
||||||
if {$ifdef AVOID_OVERFLOW} (lo(value) <> low_value) and {$endif} is_imm12(-aint(lo(value))) then
|
if {$ifdef AVOID_OVERFLOW} (abs(value) <= max_12_bit) and {$endif} is_imm12(-aint(lo(value))) then
|
||||||
list.concat(taicpu.op_reg_reg_const(A_ADDI,tmplo,regsrc.reglo,-aint(lo(value))))
|
list.concat(taicpu.op_reg_reg_const(A_ADDI,tmplo,regsrc.reglo,-aint(lo(value))))
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user