瀏覽代碼

+ optimize OP_XOR by 0 to OP_NONE in optimize_op_const

git-svn-id: trunk@35936 -
nickysn 8 年之前
父節點
當前提交
9a1812dfd9
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      compiler/cgobj.pas

+ 6 - 0
compiler/cgobj.pas

@@ -1505,6 +1505,12 @@ implementation
                 if a=0 then
                   op:=OP_MOVE;
             end;
+          OP_XOR :
+            begin
+              { xor with zero returns same result }
+              if a = 0 then
+                op:=OP_NONE;
+            end;
           OP_DIV :
             begin
               { division by 1 returns result }