* patch by J. Gareth Moreton: fix for incorrect alignment removal, resolves #37420

git-svn-id: trunk@45864 -
This commit is contained in:
florian 2020-07-26 14:41:50 +00:00
parent 091862cd88
commit a172064767

View File

@ -1690,12 +1690,16 @@ Unit AoptObj;
if (hp1.typ=ait_instruction) and (taicpu(hp1).is_jmp) then
RemoveDelaySlot(hp1);
{$endif cpudelayslot}
if (hp1.typ = ait_align) then
hp2 := hp1;
while (hp2.typ = ait_align) do
begin
{ Only remove the align if a label doesn't immediately follow }
if GetNextInstruction(hp1, hp2) and (hp2.typ = ait_label) then
if GetNextInstruction(hp2, hp2) and (hp2.typ = ait_label) then
{ The label is unskippable }
Exit;
{ Check again in case there's more than one adjacent alignment entry
(a frequent construct under x86, for example). [Kit] }
end;
asml.remove(hp1);
hp1.free;