From 9a1812dfd957f26b481aa2edc42e419c1bb24ed0 Mon Sep 17 00:00:00 2001 From: nickysn Date: Mon, 24 Apr 2017 14:26:33 +0000 Subject: [PATCH] + optimize OP_XOR by 0 to OP_NONE in optimize_op_const git-svn-id: trunk@35936 - --- compiler/cgobj.pas | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/cgobj.pas b/compiler/cgobj.pas index 129e80dd28..55f8c6f25d 100644 --- a/compiler/cgobj.pas +++ b/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 }