From: Marc Glisse Date: Fri, 20 May 2016 09:44:50 +0000 (+0200) Subject: PR71206: inconsistent types after match.pd transformation X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d78789f516307fbf256e2ba6d1d8a0aef99ee3c9;p=gcc.git PR71206: inconsistent types after match.pd transformation 2016-05-20 Marc Glisse 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c6b2a23159d..f874a6ca1c5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-05-20 Marc Glisse + + PR tree-optimization/71079 + PR tree-optimization/71206 + * match.pd ((X ^ Y) ^ (X ^ Z)): Convert the arguments. + 2016-05-20 Prathamesh Kulkarni * tree-vectorizer.c (get_vec_alignment_for_decl): New static function. diff --git a/gcc/match.pd b/gcc/match.pd index eddacd4dd1c..f11ce7c9712 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -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)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fa29e0cb4c0..ce47e644ca0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-05-20 Marc Glisse + + PR tree-optimization/71079 + PR tree-optimization/71206 + * gcc.dg/tree-ssa/pr71206.c: New testcase. + 2016-05-20 Prathamesh Kulkarni * 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 index 00000000000..8e4cd36a24a --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-ssa/71206.c @@ -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; +}