- function TAoptBaseCpu.RegModifiedByInstruction(Reg: TRegister; p1: tai): boolean;
+ function TAoptBaseCpu.RegModifiedByInstruction(reg: tregister; p1: tai): boolean;
var
var
- i : Longint;
+ i: longint;
+ preg: tregister;
begin
begin
result:=false;
result:=false;
for i:=0 to taicpu(p1).ops-1 do
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:
+ begin
+ preg:=taicpu(p1).oper[i]^.reg;
+ if (getregtype(preg)=getregtype(reg)) and
+ (getsupreg(preg)=getsupreg(reg)) and
+ (taicpu(p1).spilling_get_operation_type(i) in [operand_write,operand_readwrite]) then
+ begin
+ result:=true;
+ exit;
+ end;
+ end;
+ top_ref:
+ begin
+ if (taicpu(p1).oper[i]^.ref^.addressmode<>am_offset) and