* patch by J. Gareth Moreton: x86: Lea2Nop for stack pointer, resolves #39225

git-svn-id: trunk@49612 -
This commit is contained in:
florian 2021-07-15 20:58:46 +00:00
parent 1c13db554c
commit 2629bd7ba9

View File

@ -3742,8 +3742,15 @@ unit aoptx86;
{ changes "lea (%reg1), %reg2" into "mov %reg1, %reg2" }
if (taicpu(p).oper[0]^.ref^.base <> NR_NO) and
(taicpu(p).oper[0]^.ref^.index = NR_NO) and
{ do not mess with leas acessing the stack pointer }
(taicpu(p).oper[1]^.reg <> NR_STACK_POINTER_REG) and
(
{ do not mess with leas accessing the stack pointer
unless it's a null operation }
(taicpu(p).oper[1]^.reg <> NR_STACK_POINTER_REG) or
(
(taicpu(p).oper[0]^.ref^.base = NR_STACK_POINTER_REG) and
(taicpu(p).oper[0]^.ref^.offset = 0)
)
) and
(not(Assigned(taicpu(p).oper[0]^.ref^.Symbol))) then
begin
if (taicpu(p).oper[0]^.ref^.offset = 0) then