+2017-06-28 Marc Glisse <marc.glisse@inria.fr>
+
+ * match.pd ((X & ~Y) | (~X & Y)): Generalize to + and ^.
+ (x * C EQ/NE y * C): New transformation.
+
2017-06-28 Christophe Lyon <christophe.lyon@linaro.org>
* genmultilib (combination_space): Accept '+' in option names.
(minus (bit_and:cs @0 @1) (bit_and:cs @0 (bit_not @1)))
(minus @1 (bit_xor @0 @1)))
-/* Simplify (X & ~Y) | (~X & Y) -> X ^ Y. */
-(simplify
- (bit_ior (bit_and:c @0 (bit_not @1)) (bit_and:c (bit_not @0) @1))
- (bit_xor @0 @1))
-(simplify
- (bit_ior:c (bit_and @0 INTEGER_CST@2) (bit_and (bit_not @0) INTEGER_CST@1))
- (if (wi::bit_not (@2) == @1)
- (bit_xor @0 @1)))
+/* Simplify (X & ~Y) |^+ (~X & Y) -> X ^ Y. */
+(for op (bit_ior bit_xor plus)
+ (simplify
+ (op (bit_and:c @0 (bit_not @1)) (bit_and:c (bit_not @0) @1))
+ (bit_xor @0 @1))
+ (simplify
+ (op:c (bit_and @0 INTEGER_CST@2) (bit_and (bit_not @0) INTEGER_CST@1))
+ (if (wi::bit_not (@2) == @1)
+ (bit_xor @0 @1))))
/* PR53979: Transform ((a ^ b) | a) -> (a | b) */
(simplify
&& tree_expr_nonzero_p (@1))
(cmp @0 @2))))
+/* For integral types with wrapping overflow and C odd fold
+ x * C EQ/NE y * C into x EQ/NE y. */
+(for cmp (eq ne)
+ (simplify
+ (cmp (mult @0 INTEGER_CST@1) (mult @2 @1))
+ (if (INTEGRAL_TYPE_P (TREE_TYPE (@1))
+ && TYPE_OVERFLOW_WRAPS (TREE_TYPE (@0))
+ && (TREE_INT_CST_LOW (@1) & 1) != 0)
+ (cmp @0 @2))))
+
/* For integral types with undefined overflow and C != 0 fold
x * C RELOP y * C into:
+2017-06-28 Marc Glisse <marc.glisse@inria.fr>
+
+ * gcc.dg/tree-ssa/addadd.c: Remove test duplicated in addadd-2.c.
+ * gcc.dg/tree-ssa/mulcmp-1.c: New file.
+
2017-06-28 Jakub Jelinek <jakub@redhat.com>
* gcc.target/i386/cmov7.c (sgn): Renamed to ...
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized-raw" } */
+
+int f(unsigned a,unsigned b){
+ a *= 3;
+ b *= 3;
+ return a == b;
+}
+
+/* { dg-final { scan-tree-dump-not "mult_expr" "optimized" } } */