diff mbox

PR71206: inconsistent types after match.pd transformation

Message ID alpine.DEB.2.02.1605200117340.17261@laptop-mg.saclay.inria.fr
State New
Headers show

Commit Message

Marc Glisse May 19, 2016, 11:23 p.m. UTC
Hello,

this was bootstrapped and regtested on powerpc64le-unknown-linux-gnu.

2016-05-20  Marc Glisse  <marc.glisse@inria.fr>

gcc/
 	* match.pd ((X ^ Y) ^ (X ^ Z)): Convert the arguments.

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

Comments

Marc Glisse May 20, 2016, 7:12 a.m. UTC | #1
On Fri, 20 May 2016, Marc Glisse wrote:

> Hello,
>
> this was bootstrapped and regtested on powerpc64le-unknown-linux-gnu.
>
> 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.
Richard Biener May 20, 2016, 9:30 a.m. UTC | #2
On Fri, May 20, 2016 at 9:12 AM, Marc Glisse <marc.glisse@inria.fr> wrote:
> On Fri, 20 May 2016, Marc Glisse wrote:
>
>> Hello,
>>
>> this was bootstrapped and regtested on powerpc64le-unknown-linux-gnu.
>>
>> 2016-05-20  Marc Glisse  <marc.glisse@inria.fr>
>
>
>         PR tree-optimization/71079
>         PR tree-optimization/71206

Ok.

Thanks,
Richard.

>
>> gcc/
>>         * match.pd ((X ^ Y) ^ (X ^ Z)): Convert the arguments.
>>
>> gcc/testsuite/
>>         * gcc.dg/tree-ssa/pr71206.c: New testcase.
>
>
> --
> Marc Glisse
diff mbox

Patch

Index: gcc/match.pd
===================================================================
--- gcc/match.pd	(revision 236489)
+++ gcc/match.pd	(working copy)
@@ -733,21 +733,21 @@  DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
        && tree_nop_conversion_p (type, TREE_TYPE (@2)))
    (if (single_use (@5) && single_use (@6))
     (op @3 (convert @2))
     (if (single_use (@3) && single_use (@4))
      (op (convert @1) @5))))))
 /* (X ^ Y) ^ (X ^ Z) -> Y ^ Z  */
 (simplify
  (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))
  @1)
 (simplify
  (abs (negate @0))
  (abs @0))
 (simplify
  (abs tree_expr_nonnegative_p@0)
  @0)
Index: gcc/testsuite/gcc.dg/tree-ssa/71206.c
===================================================================
--- gcc/testsuite/gcc.dg/tree-ssa/71206.c	(revision 0)
+++ gcc/testsuite/gcc.dg/tree-ssa/71206.c	(working copy)
@@ -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;
+}