https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119402
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
```
(simplify
(bit_and:c (mult:c zero_one_valued_p @0) @1)
(with { bool wascmp; }
(if (bitwise_inverted_equal_p (@0, @1, wascmp))
{ build_zero_cst (type); })))
```
Or maybe just
```
(simplify
(bit_and:c (mult:c zero_one_valued_p@2 @0) @1)
(mult @2 (bit_and @0 @1))
```
Still deciding if we want ! on the bit_and or not.
Is enough and allows to optimize even:
```
unsigned x(_Bool iftmp, unsigned _6)
{
return (iftmp * _6) & (_6);
}
```
Most likely also should handle this inside re-association and turn
zero_one_valued_p*b into (-zero_one_valued_p) & b to allow re-association too
so that:
unsigned x(_Bool iftmp, unsigned _6, unsigned _7)
{
return (iftmp * _6) & ((_7) & ~_6);
}
Is optimized too.