From ba1b0883c2771b3a4b9e5ab3954d2a9ea960cad6 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 27 Jun 2021 20:51:03 +0000 Subject: [PATCH] * r/esp cannot be used as index register git-svn-id: trunk@49567 - --- compiler/x86/aoptx86.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/x86/aoptx86.pas b/compiler/x86/aoptx86.pas index 50b47fbe76..e7ba8b4c90 100644 --- a/compiler/x86/aoptx86.pas +++ b/compiler/x86/aoptx86.pas @@ -8418,7 +8418,9 @@ unit aoptx86; ( ( (taicpu(hp1).oper[0]^.ref^.base = taicpu(p).oper[1]^.reg) and - (taicpu(hp1).oper[0]^.ref^.index = NR_NO) + (taicpu(hp1).oper[0]^.ref^.index = NR_NO) and + { r/esp cannot be an index } + (taicpu(p).oper[0]^.reg<>NR_STACK_POINTER_REG) ) or ( (taicpu(hp1).oper[0]^.ref^.index = taicpu(p).oper[1]^.reg) and (taicpu(hp1).oper[0]^.ref^.base = NR_NO)