PR71206: inconsistent types after match.pd transformation
authorMarc Glisse <marc.glisse@inria.fr>
Fri, 20 May 2016 09:44:50 +0000 (11:44 +0200)
committerMarc Glisse <glisse@gcc.gnu.org>
Fri, 20 May 2016 09:44:50 +0000 (09:44 +0000)
2016-05-20  Marc Glisse  <marc.glisse@inria.fr>

PR tree-optimization/71079
PR tree-optimization/71206
gcc/
* match.pd ((X ^ Y) ^ (X ^ Z)): Convert the arguments.

gcc/testsuite/
* gcc.dg/tree-ssa/pr71206.c: New testcase.

From-SVN: r236504

gcc/ChangeLog
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/71206.c [new file with mode: 0644]

index c6b2a23159d04a0e32298df6df9c079cb341c1d0..f874a6ca1c5c548c2cd8b7d5d1cecb08d74238cf 100644 (file)
@@ -1,3 +1,9 @@
+2016-05-20  Marc Glisse  <marc.glisse@inria.fr>
+
+       PR tree-optimization/71079
+       PR tree-optimization/71206
+       * match.pd ((X ^ Y) ^ (X ^ Z)): Convert the arguments.
+
 2016-05-20  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
 
        * tree-vectorizer.c (get_vec_alignment_for_decl): New static function.
index eddacd4dd1c333ec404b87f1079d61838470c6b8..f11ce7c9712f06a66783025272d103a731774107 100644 (file)
@@ -740,7 +740,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
  (bit_xor (convert1? (bit_xor:c @0 @1)) (convert2? (bit_xor:c @0 @2)))
  (if (tree_nop_conversion_p (type, TREE_TYPE (@1))
       && tree_nop_conversion_p (type, TREE_TYPE (@2)))
-  (convert (bit_xor @1 @2))))
+  (bit_xor (convert @1) (convert @2))))
 
 (simplify
  (abs (abs@1 @0))
index fa29e0cb4c0dc49c43f1b2649a46ceb0a17f06ce..ce47e644ca0fb1e8010c6f54909a24cfa216473c 100644 (file)
@@ -1,3 +1,9 @@
+2016-05-20  Marc Glisse  <marc.glisse@inria.fr>
+
+       PR tree-optimization/71079
+       PR tree-optimization/71206
+       * gcc.dg/tree-ssa/pr71206.c: New testcase.
+
 2016-05-20  Prathamesh Kulkarni  <prathamesh.kulkarni@linaro.org>
 
        * gcc.dg/vect/section-anchors-vect-70.c: New test-case.
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/71206.c b/gcc/testsuite/gcc.dg/tree-ssa/71206.c
new file mode 100644 (file)
index 0000000..8e4cd36
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+int f(int d, unsigned b) {
+    int i2 = b ^ 1;
+    int i4 = d ^ 1;
+    return i2 ^ i4;
+}