summaryrefslogtreecommitdiff
path: root/gcc/gimple.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-08 13:11:56 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-08 13:11:56 +0000
commitd701b871e8562defb7f0de069fb925d6ab2ad597 (patch)
tree2cbc77ce6bebb52b13d7fbb0ce405e72e23a88c3 /gcc/gimple.c
parent0bf5f81bf20bb498c0f734727b6a940b3f6bb94f (diff)
downloadgcc-d701b871e8562defb7f0de069fb925d6ab2ad597.tar.gz
* gimple.c (canonicalize_cond_expr_cond): Rewrite x ^ y into
x != y. * gcc.dg/tree-ssa/forwprop-25.c: New test git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197579 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r--gcc/gimple.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 785c2f021a7..cdb6f2498a8 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -2958,7 +2958,11 @@ canonicalize_cond_expr_cond (tree t)
t = build2 (TREE_CODE (top0), TREE_TYPE (t),
TREE_OPERAND (top0, 0), TREE_OPERAND (top0, 1));
}
-
+ /* For x ^ y use x != y. */
+ else if (TREE_CODE (t) == BIT_XOR_EXPR)
+ t = build2 (NE_EXPR, TREE_TYPE (t),
+ TREE_OPERAND (t, 0), TREE_OPERAND (t, 1));
+
if (is_gimple_condexpr (t))
return t;