https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107880

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
With a patch I have for PR 95185

we get:
```
  _1 = b_2(D) == a_3(D);
  _10 = b_2(D) ^ a_3(D);
  _5 = _1 ^ _10;
```

Which is better than before.

One more improvement would be:
```
bool a(bool x, bool y)
{
        bool t = x == y;
        return t ^ x;
}
```

Into:
```
bool a0(bool x, bool y)
{
        bool t = (x ^ y);
        return t ^ x ^1; // ~y
}
```

So the 2 which are needed still:

/* (a == b) ^ a -> b^1 */
(simplify
 (bit_xor:c (eq:c zero_one_valued_p@0 zero_one_valued_p@1) @0)
 (bit_xor @1 { build_one_cst (type); })

/* (a == b) ^ (a^b) -> b^(b^1) or (b^b)^1 or rather 1 */
(simplify
 (bit_xor:c (eq:c zero_one_valued_p@0 zero_one_valued_p@1) (bit_xor:c @0 @1))
 { build_one_cst (type); })

So mine.

Reply via email to