mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 20:00:15 +02:00
* AVR: fix TAoptBaseCpu.RegModifiedByInstruction, resolves #39623
This commit is contained in:
parent
e87c52d7dc
commit
49edb0b606
@ -117,13 +117,22 @@ Implementation
|
|||||||
i : Longint;
|
i : Longint;
|
||||||
begin
|
begin
|
||||||
result:=false;
|
result:=false;
|
||||||
If (p1.typ = ait_instruction) and (taicpu(p1).opcode in [A_MUL,A_MULS,A_FMUL,A_FMULS,A_FMULSU]) and
|
if p1.typ <> ait_instruction then
|
||||||
|
exit;
|
||||||
|
If (taicpu(p1).opcode in [A_MUL,A_MULS,A_FMUL,A_FMULS,A_FMULSU]) and
|
||||||
((getsupreg(reg)=RS_R0) or (getsupreg(reg)=RS_R1)) then
|
((getsupreg(reg)=RS_R0) or (getsupreg(reg)=RS_R1)) then
|
||||||
begin
|
begin
|
||||||
Result:=true;
|
Result:=true;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
If (taicpu(p1).opcode=A_MOVW) and
|
||||||
|
(TRegister(ord(taicpu(p1).oper[0]^.reg)+1)=reg) then
|
||||||
|
begin
|
||||||
|
Result:=true;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
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
|
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
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user