mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-31 22:10:51 +02:00
Avoid overflow error in riscv code generator
git-svn-id: trunk@40318 -
This commit is contained in:
parent
6a6ea6729f
commit
7c92412c74
@ -88,7 +88,10 @@ implementation
|
||||
hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,false);
|
||||
|
||||
if (right.location.loc=LOC_CONSTANT) and
|
||||
(not is_imm12(-right.location.value)) then
|
||||
{ right.location.value might be $8000000000000000,
|
||||
and its minus value generates an overflow here }
|
||||
{$ifopt Q+} ((right.location.value = int64($8000000000000000)) or {$endif}
|
||||
(not is_imm12(-right.location.value)) {$ifopt Q+}){$endif} then
|
||||
hlcg.location_force_reg(current_asmdata.CurrAsmList,right.location,right.resultdef,right.resultdef,false);
|
||||
|
||||
if right.location.loc=LOC_CONSTANT then
|
||||
@ -103,7 +106,10 @@ implementation
|
||||
hlcg.location_force_reg(current_asmdata.CurrAsmList,left.location,left.resultdef,left.resultdef,false);
|
||||
|
||||
if (right.location.loc=LOC_CONSTANT) and
|
||||
(not is_imm12(-right.location.value)) then
|
||||
{ right.location.value might be $8000000000000000,
|
||||
and its minus value generates an overflow here }
|
||||
{$ifopt Q+} ((right.location.value = int64($8000000000000000)) or {$endif}
|
||||
(not is_imm12(-right.location.value)) {$ifopt Q+}){$endif} then
|
||||
hlcg.location_force_reg(current_asmdata.CurrAsmList,right.location,right.resultdef,right.resultdef,false);
|
||||
|
||||
if right.location.loc=LOC_CONSTANT then
|
||||
|
Loading…
Reference in New Issue
Block a user