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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
bool f(bool a, bool b)
{
    int t = a;
    int t1 = b;
    return (t + t1) & 2;
}
bool f1(bool a, bool b)
{
    int t = a;
    int t1 = b;
    return (t & t1);
}

This is needed too:
```
(simplify
  (ne (bit_and (plus zero_one_valued_p@0 zero_one_valued_p@1) INTEGER_CST@2)
integer_zerop)
  (if (wi::to_wide (@2) == 2)
    (convert (bit_and @0 @1))
    (if (wi::to_wide (@2) == 1)
     (convert (bit_xor @0 @1)))
  )
)
```

As we don't want to convert `(bool+bool)&2` into `(bool^bool)<<1`

Reply via email to