summaryrefslogtreecommitdiff
path: root/gcc/gimple.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2013-04-08 07:11:56 -0600
committerJeff Law <law@gcc.gnu.org>2013-04-08 07:11:56 -0600
commit4481581f34be81348f36276e290c80d59fbf49c6 (patch)
tree2cbc77ce6bebb52b13d7fbb0ce405e72e23a88c3 /gcc/gimple.c
parent451dabda42522372cfe55e7b6433b19b6df625d2 (diff)
downloadgcc-4481581f34be81348f36276e290c80d59fbf49c6.tar.gz
gimple.c (canonicalize_cond_expr_cond): Rewrite x ^ y into x != y.
* gimple.c (canonicalize_cond_expr_cond): Rewrite x ^ y into x != y. * gcc.dg/tree-ssa/forwprop-25.c: New test From-SVN: r197579
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;