Browse Source

* fixed TX86AsmOptimizer.RegLoadedWithNewValue for 3-operand imul, where the
second operand is a memory reference

git-svn-id: trunk@36067 -

nickysn 8 years ago
parent
commit
65960048c8
1 changed files with 2 additions and 1 deletions
  1. 2 1
      compiler/x86/aoptx86.pas

+ 2 - 1
compiler/x86/aoptx86.pas

@@ -438,7 +438,8 @@ unit aoptx86;
           ((p.opcode = A_IMUL) and
            (p.ops=3) and
            (Reg1WriteOverwritesReg2Entirely(p.oper[2]^.reg,reg)) and
-           not((Reg1ReadDependsOnReg2(p.oper[1]^.reg,reg))));
+           (((p.oper[1]^.typ=top_reg) and not(Reg1ReadDependsOnReg2(p.oper[1]^.reg,reg))) or
+            ((p.oper[1]^.typ=top_ref) and not(RegInRef(reg,p.oper[1]^.ref^)))));
       end;