Browse Source

* x86: Bug fix in OptPass1MOV long-range optimisations where
the wrong register was checked to see if had changed.

J. Gareth "Curious Kit" Moreton 1 year ago
parent
commit
d5c6286852
1 changed files with 1 additions and 1 deletions
  1. 1 1
      compiler/x86/aoptx86.pas

+ 1 - 1
compiler/x86/aoptx86.pas

@@ -4622,7 +4622,7 @@ unit aoptx86;
                       (taicpu(p).oper[0]^.typ = top_reg) and
                       MatchOpType(taicpu(hp2), top_reg, top_reg) and
                       SuperRegistersEqual(p_TargetReg, taicpu(hp2).oper[0]^.reg) and
-                      not RegModifiedBetween(p_TargetReg, p, hp2) then
+                      not RegModifiedBetween(taicpu(p).oper[0]^.reg, p, hp2) then
                       begin
                         TempRegUsed :=
                           CrossJump { Assume the register is in use if it crossed a conditional jump } or