Browse Source

* cleanup

git-svn-id: trunk@43863 -
florian 5 years ago
parent
commit
22cb46fca9
1 changed files with 5 additions and 8 deletions
  1. 5 8
      compiler/x86/aoptx86.pas

+ 5 - 8
compiler/x86/aoptx86.pas

@@ -2028,12 +2028,10 @@ unit aoptx86;
            MatchOpType(taicpu(p),top_reg,top_reg) and
            MatchOpType(taicpu(p),top_reg,top_reg) and
            ((MatchInstruction(hp1,A_OR,A_AND,A_TEST,[]) and
            ((MatchInstruction(hp1,A_OR,A_AND,A_TEST,[]) and
             MatchOperand(taicpu(p).oper[1]^,taicpu(hp1).oper[0]^) and
             MatchOperand(taicpu(p).oper[1]^,taicpu(hp1).oper[0]^) and
-            (taicpu(hp1).oper[1]^.typ = top_reg) and
-            (taicpu(hp1).oper[0]^.reg = taicpu(hp1).oper[1]^.reg)) or
+            MatchOperand(taicpu(p).oper[1]^,taicpu(hp1).oper[1]^)) or
             (MatchInstruction(hp1,A_CMP,[]) and
             (MatchInstruction(hp1,A_CMP,[]) and
-            MatchOperand(taicpu(p).oper[1]^,taicpu(hp1).oper[1]^) and
-            MatchOpType(taicpu(hp1),top_const,top_reg) and
-            (taicpu(p).oper[1]^.reg = taicpu(hp1).oper[1]^.reg)
+             MatchOperand(taicpu(p).oper[1]^,taicpu(hp1).oper[1]^) and
+             MatchOpType(taicpu(hp1),top_const,top_reg)
             )
             )
            ) then
            ) then
            {  we have
            {  we have
@@ -2043,6 +2041,7 @@ unit aoptx86;
            }
            }
            begin
            begin
              TransferUsedRegs(TmpUsedRegs);
              TransferUsedRegs(TmpUsedRegs);
+             UpdateUsedRegs(TmpUsedRegs, tai(p.next));
              { reg1 will be used after the first instruction,
              { reg1 will be used after the first instruction,
                so update the allocation info                  }
                so update the allocation info                  }
              AllocRegBetween(taicpu(p).oper[0]^.reg,p,hp1,usedregs);
              AllocRegBetween(taicpu(p).oper[0]^.reg,p,hp1,usedregs);
@@ -2066,9 +2065,7 @@ unit aoptx86;
                      taicpu(hp1).loadoper(0,taicpu(p).oper[0]^);
                      taicpu(hp1).loadoper(0,taicpu(p).oper[0]^);
                    taicpu(hp1).loadoper(1,taicpu(p).oper[0]^);
                    taicpu(hp1).loadoper(1,taicpu(p).oper[0]^);
                    DebugMsg(SPeepholeOptimization + 'MovTest/Cmp/Or/AndJxx2Test/Cmp/Or/AndJxx done',p);
                    DebugMsg(SPeepholeOptimization + 'MovTest/Cmp/Or/AndJxx2Test/Cmp/Or/AndJxx done',p);
-                   asml.remove(p);
-                   p.free;
-                   p := hp1;
+                   RemoveCurrentP(p);
                    Exit;
                    Exit;
                  end
                  end
                else
                else