From 7a4110cca91f7fcb4097d156104bf7e12021bc52 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 4 Jul 2021 20:46:02 +0000 Subject: [PATCH] * DeepMovOpt requires that the target reg of the mov is not modified before hp2 git-svn-id: trunk@49577 - --- 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 1705508772..abce6a3d2a 100644 --- a/compiler/x86/aoptx86.pas +++ b/compiler/x86/aoptx86.pas @@ -2811,6 +2811,9 @@ unit aoptx86; if not RegModifiedByInstruction(taicpu(p).oper[0]^.reg, hp1) and not RegModifiedBetween(taicpu(p).oper[0]^.reg, hp1, hp2) and + { if we replace taicpu(p).oper[1]^.reg by taicpu(p).oper[0]^.reg, + taicpu(p).oper[1]^.reg might not be modified in between } + not RegModifiedBetween(CurrentReg, p, hp2) and DeepMovOpt(taicpu(p), taicpu(hp2)) then begin { Just in case something didn't get modified (e.g. an @@ -2838,7 +2841,6 @@ unit aoptx86; hp3 := hp2; Continue; end; - end; end; end;