mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 17:00:40 +02:00
* patch by J. Gareth Moreton to clean up TX86AsmOptimizer.OptPass2Jcc, resolves #36295
git-svn-id: trunk@43452 -
This commit is contained in:
parent
7bf50d261e
commit
83a11c2a7d
@ -3392,26 +3392,8 @@ unit aoptx86;
|
|||||||
GetNextInstruction(hp1,hp1);
|
GetNextInstruction(hp1,hp1);
|
||||||
until not(CanBeCMOV(hp1));
|
until not(CanBeCMOV(hp1));
|
||||||
|
|
||||||
{ Don't decrement the reference count on the label yet, otherwise
|
{ Remember what hp1 is in case there's multiple aligns to get rid of }
|
||||||
GetNextInstruction might skip over the label if it drops to
|
hp2 := hp1;
|
||||||
zero. }
|
|
||||||
GetNextInstruction(hp1,hp2);
|
|
||||||
|
|
||||||
{ if the label refs. reach zero, remove any alignment before the label }
|
|
||||||
if (hp1.typ = ait_align) and (hp2.typ = ait_label) then
|
|
||||||
begin
|
|
||||||
{ Ref = 1 means it will drop to zero }
|
|
||||||
if (tasmlabel(symbol).getrefs=1) then
|
|
||||||
begin
|
|
||||||
asml.Remove(hp1);
|
|
||||||
hp1.Free;
|
|
||||||
end;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
hp2 := hp1;
|
|
||||||
|
|
||||||
{ Remember what the first hp2 is in case there's multiple aligns and labels to get rid of }
|
|
||||||
hp3 := hp2;
|
|
||||||
repeat
|
repeat
|
||||||
if not Assigned(hp2) then
|
if not Assigned(hp2) then
|
||||||
InternalError(2018062910);
|
InternalError(2018062910);
|
||||||
@ -3444,7 +3426,7 @@ unit aoptx86;
|
|||||||
|
|
||||||
{ Remove the label if this is its final reference }
|
{ Remove the label if this is its final reference }
|
||||||
if (tasmlabel(symbol).getrefs=0) then
|
if (tasmlabel(symbol).getrefs=0) then
|
||||||
StripLabelFast(hp3);
|
StripLabelFast(hp1);
|
||||||
|
|
||||||
if Assigned(p) then
|
if Assigned(p) then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user