mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 05:59:28 +02:00
* ARM: instructions do modify the base register of pre/postindexed references. Report this fact in spilling_get_operation_type_ref and RegModifiedByInstruction functions.
git-svn-id: trunk@28708 -
This commit is contained in:
parent
2e0707f465
commit
d37e72dbf9
@ -212,7 +212,7 @@ uses
|
||||
function is_same_reg_move(regtype: Tregistertype):boolean; override;
|
||||
|
||||
function spilling_get_operation_type(opnr: longint): topertype;override;
|
||||
|
||||
function spilling_get_operation_type_ref(opnr: longint; reg: tregister): topertype;override;
|
||||
{ assembler }
|
||||
public
|
||||
{ the next will reset all instructions that can change in pass 2 }
|
||||
@ -777,6 +777,15 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
function taicpu.spilling_get_operation_type_ref(opnr: longint; reg: tregister): topertype;
|
||||
begin
|
||||
result := operand_read;
|
||||
if (oper[opnr]^.ref^.base = reg) and
|
||||
(oper[opnr]^.ref^.addressmode in [AM_PREINDEXED,AM_POSTINDEXED]) then
|
||||
result := operand_readwrite;
|
||||
end;
|
||||
|
||||
|
||||
procedure BuildInsTabCache;
|
||||
var
|
||||
i : longint;
|
||||
|
@ -124,11 +124,14 @@ Implementation
|
||||
begin
|
||||
result:=false;
|
||||
for i:=0 to taicpu(p1).ops-1 do
|
||||
if (taicpu(p1).oper[i]^.typ=top_reg) and (taicpu(p1).oper[i]^.reg=Reg) and (taicpu(p1).spilling_get_operation_type(i) in [operand_write,operand_readwrite]) then
|
||||
begin
|
||||
result:=true;
|
||||
exit;
|
||||
end;
|
||||
case taicpu(p1).oper[i]^.typ of
|
||||
top_reg:
|
||||
if (taicpu(p1).oper[i]^.reg=Reg) and (taicpu(p1).spilling_get_operation_type(i) in [operand_write,operand_readwrite]) then
|
||||
exit(true);
|
||||
top_ref:
|
||||
if (taicpu(p1).spilling_get_operation_type_ref(i,Reg)<>operand_read) then
|
||||
exit(true);
|
||||
end;
|
||||
end;
|
||||
|
||||
End.
|
||||
|
Loading…
Reference in New Issue
Block a user