mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 04:29:20 +02:00
* CollapseZeroDistJump no longer updates registers or strips dead labels, instead just setting p to p.Next
This commit is contained in:
parent
c21bf747fb
commit
e7e4044bf0
@ -2185,7 +2185,7 @@ Unit AoptObj;
|
|||||||
|
|
||||||
function TAOptObj.CollapseZeroDistJump(var p: tai; ThisLabel: TAsmLabel): Boolean;
|
function TAOptObj.CollapseZeroDistJump(var p: tai; ThisLabel: TAsmLabel): Boolean;
|
||||||
var
|
var
|
||||||
tmp, hp1: tai;
|
hp1: tai;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
if not GetNextInstruction(p,hp1) then
|
if not GetNextInstruction(p,hp1) then
|
||||||
@ -2203,15 +2203,11 @@ Unit AoptObj;
|
|||||||
{$ifdef cpudelayslot}
|
{$ifdef cpudelayslot}
|
||||||
RemoveDelaySlot(p);
|
RemoveDelaySlot(p);
|
||||||
{$endif cpudelayslot}
|
{$endif cpudelayslot}
|
||||||
tmp := tai(p.Next); { Might be an align before the label, so keep a note of it }
|
hp1 := tai(p.Next);
|
||||||
asml.remove(p);
|
{ Use RemoveInstruction, not RemoveCurrentP, since the latter also
|
||||||
p.free;
|
updates the registers }
|
||||||
|
RemoveInstruction(p);
|
||||||
StripDeadLabels(tmp, p);
|
p := hp1;
|
||||||
|
|
||||||
if p.typ <> ait_instruction then
|
|
||||||
GetNextInstruction(UpdateUsedRegsAndOptimize(p), p);
|
|
||||||
|
|
||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user