* skip align directives after unconditional jumps

git-svn-id: trunk@40160 -
This commit is contained in:
florian 2018-11-01 20:49:18 +00:00
parent a092da723a
commit 2a016889de
2 changed files with 6 additions and 6 deletions

View File

@ -1551,7 +1551,7 @@ Unit AoptObj;
and (hp1.typ <> ait_jcatch) and (hp1.typ <> ait_jcatch)
{$endif} {$endif}
do do
if not(hp1.typ in ([ait_label,ait_align]+skipinstr)) then if not(hp1.typ in ([ait_label]+skipinstr)) then
begin begin
if (hp1.typ = ait_instruction) and if (hp1.typ = ait_instruction) and
taicpu(hp1).is_jmp and taicpu(hp1).is_jmp and
@ -1560,7 +1560,7 @@ Unit AoptObj;
TAsmLabel(JumpTargetOp(taicpu(hp1))^.ref^.symbol).decrefs; TAsmLabel(JumpTargetOp(taicpu(hp1))^.ref^.symbol).decrefs;
{ don't kill start/end of assembler block, { don't kill start/end of assembler block,
no-line-info-start/end etc } no-line-info-start/end etc }
if hp1.typ<>ait_marker then if not(hp1.typ in [ait_align,ait_marker]) then
begin begin
{$ifdef cpudelayslot} {$ifdef cpudelayslot}
if (hp1.typ=ait_instruction) and (taicpu(hp1).is_jmp) then if (hp1.typ=ait_instruction) and (taicpu(hp1).is_jmp) then

View File

@ -524,18 +524,18 @@ begin
{ Handle Jmp Optimizations } { Handle Jmp Optimizations }
if taicpu(p).is_jmp then if taicpu(p).is_jmp then
begin begin
{the following if-block removes all code between a jmp and the next label, { the following if-block removes all code between a jmp and the next label,
because it can never be executed} because it can never be executed }
if (taicpu(p).opcode = A_JMP) then if (taicpu(p).opcode = A_JMP) then
begin begin
hp2:=p; hp2:=p;
while GetNextInstruction(hp2, hp1) and while GetNextInstruction(hp2, hp1) and
(hp1.typ <> ait_label) do (hp1.typ <> ait_label) do
if not(hp1.typ in ([ait_label,ait_align]+skipinstr)) then if not(hp1.typ in ([ait_label]+skipinstr)) then
begin begin
{ don't kill start/end of assembler block, { don't kill start/end of assembler block,
no-line-info-start/end etc } no-line-info-start/end etc }
if hp1.typ<>ait_marker then if not(hp1.typ in [ait_align,ait_marker]) then
begin begin
asml.remove(hp1); asml.remove(hp1);
hp1.free; hp1.free;