From ff415ba39c27148c52edca43e145b46d4cd4ebfa Mon Sep 17 00:00:00 2001 From: pierre Date: Thu, 21 Nov 2019 10:00:20 +0000 Subject: [PATCH] Fixes by Gareth Moreton for problems exposed by use of -CriotR option git-svn-id: trunk@43529 - --- compiler/aoptobj.pas | 6 +++--- compiler/x86/aoptx86.pas | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/compiler/aoptobj.pas b/compiler/aoptobj.pas index 006e3de058..7d7bbd27ac 100644 --- a/compiler/aoptobj.pas +++ b/compiler/aoptobj.pas @@ -381,7 +381,7 @@ Unit AoptObj; procedure MakeUnconditional(p: taicpu); virtual; { Removes all instructions between an unconditional jump and the next label } - procedure RemoveDeadCodeAfterJump(p: taicpu); + procedure RemoveDeadCodeAfterJump(p: tai); { If hp is a label, strip it if its reference count is zero. Repeat until a non-label is found, or a label with a non-zero reference count. @@ -1615,7 +1615,7 @@ Unit AoptObj; { Removes all instructions between an unconditional jump and the next label } - procedure TAOptObj.RemoveDeadCodeAfterJump(p: taicpu); + procedure TAOptObj.RemoveDeadCodeAfterJump(p: tai); var hp1, hp2: tai; begin @@ -1657,7 +1657,7 @@ Unit AoptObj; hp1.free; end else - p:=taicpu(hp1); + p:=hp1; end else Break; diff --git a/compiler/x86/aoptx86.pas b/compiler/x86/aoptx86.pas index 7cdc0f3652..a4f868296d 100644 --- a/compiler/x86/aoptx86.pas +++ b/compiler/x86/aoptx86.pas @@ -2057,6 +2057,8 @@ unit aoptx86; p.Free; hp2.Free; p := hp1; + Result := True; + Exit; end; end; if MatchOpType(taicpu(hp2),top_reg,top_reg) and