summaryrefslogtreecommitdiff
path: root/compiler/arm/aasmcpu.pas
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/arm/aasmcpu.pas')
-rw-r--r--compiler/arm/aasmcpu.pas20
1 files changed, 15 insertions, 5 deletions
diff --git a/compiler/arm/aasmcpu.pas b/compiler/arm/aasmcpu.pas
index 58b8010226..1086f17867 100644
--- a/compiler/arm/aasmcpu.pas
+++ b/compiler/arm/aasmcpu.pas
@@ -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;
@@ -1055,15 +1064,16 @@ implementation
(tai(hp).typ=ait_instruction) then
begin
case taicpu(hp).opcode of
- A_BX,
+ A_MOV,
A_LDR,
A_ADD:
{ approximation if we hit a case jump table }
if ((taicpu(hp).opcode in [A_ADD,A_LDR]) and not(GenerateThumbCode or GenerateThumb2Code) and
(taicpu(hp).oper[0]^.typ=top_reg) and
(taicpu(hp).oper[0]^.reg=NR_PC)) or
- ((taicpu(hp).opcode=A_BX) and (GenerateThumbCode) and
- (taicpu(hp).oper[0]^.typ=top_reg))
+ ((taicpu(hp).opcode=A_MOV) and (GenerateThumbCode) and
+ (taicpu(hp).oper[0]^.typ=top_reg) and
+ (taicpu(hp).oper[0]^.reg=NR_PC))
then
begin
penalty:=multiplier;
@@ -1858,7 +1868,7 @@ implementation
ot:=OT_SHIFTEROP;
end;
else
- internalerror(200402261);
+ internalerror(2004022623);
end;
end;
end;