Browse Source

* make ShlOp2Op optimization more fool proof

florian 3 years ago
parent
commit
37bb10e893
1 changed files with 1 additions and 0 deletions
  1. 1 0
      compiler/x86/aoptx86.pas

+ 1 - 0
compiler/x86/aoptx86.pas

@@ -4691,6 +4691,7 @@ unit aoptx86;
           MatchInstruction(hp1,A_MOV,A_LEA,[]) and
           MatchInstruction(hp1,A_MOV,A_LEA,[]) and
           MatchOpType(taicpu(hp1), top_ref, top_reg) and
           MatchOpType(taicpu(hp1), top_ref, top_reg) and
           (taicpu(p).oper[1]^.reg=taicpu(hp1).oper[0]^.ref^.index) and
           (taicpu(p).oper[1]^.reg=taicpu(hp1).oper[0]^.ref^.index) and
+          (taicpu(p).oper[1]^.reg<>taicpu(hp1).oper[0]^.ref^.base) and
           (taicpu(hp1).oper[0]^.ref^.scalefactor in [0,1]) then
           (taicpu(hp1).oper[0]^.ref^.scalefactor in [0,1]) then
           begin
           begin
             TransferUsedRegs(TmpUsedRegs);
             TransferUsedRegs(TmpUsedRegs);