https://gcc.gnu.org/bugzilla/show_bug.cgi?id=129127
--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
We have:
```
/* (x | c) & ~(y | c) -> x & ~(y | c) */
/* (x & c) | ~(y & c) -> x | ~(y & c) */
(simplify
(bitop:c (rbitop:c @0 @1) (bit_not@3 (rbitop:c @1 @2)))
(bitop @0 @3))
```
Not the one with both bitop it seems.
Note this is the other & case:
```
unsigned g(unsigned A, unsigned b, unsigned c)
{
return (~(A&b)) & (A & c);
}
unsigned g_tgt(unsigned A, unsigned b, unsigned c)
{
return (A&~b) & c;
}
```
xor (^) is handled already though, but via `(~x ^ y) -> ~(x ^ y)` (that moves
the ~ to the outside) and then `(X ^ Y) ^ (X ^ Z) -> Y ^ Z`. :
```
unsigned h(unsigned A, unsigned b, unsigned c)
{
return (~(A^b)) ^ (A ^ c);
}
unsigned h_tgt(unsigned A, unsigned b, unsigned c)
{
return (c^~b);
}
```