https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113072
Andrew Pinski changed:
What|Removed |Added
Resolution|--- |DUPLICATE
Status|ASSIGNED
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113072
--- Comment #5 from Andrew Pinski ---
(In reply to Andrew Pinski from comment #2)
> Looks like bool sometimes produces != or ^ :)
> ```
> bool foo(bool a, int b)
> {
> bool b1 = b == 1;
> bool b2 = !b1;
> bool c = (a ^
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113072
--- Comment #4 from Andrew Pinski ---
Note this applies to `|` instead of `&` too:
```
int foo1(int a, int b)
{
return (a ^ 4) | (~a ^ 4);
}
```
This should be optimized to `-1`. Though this does NOT get optimized to `-1` on
the RTL
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113072
--- Comment #3 from Andrew Pinski ---
here is the bool testcase which just allows the use of ^:
```
bool foo1(bool a, int b)
{
bool b1 = b == 1;
bool b2 = !b1;
return (a ^ b1) & (a ^ b2);
}
```
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113072
Andrew Pinski changed:
What|Removed |Added
See Also||https://gcc.gnu.org/bugzill
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113072
Andrew Pinski changed:
What|Removed |Added
Status|UNCONFIRMED |ASSIGNED
Ever confirmed|0
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113072
--- Comment #1 from Andrew Pinski ---
Wait this part is wrong `which does basically `(a ^ 4) & (a ^ (~4))` -> `(4 ^
(~4)) & (a ^ a)` which is 0 as `a ^ a` is 0.`
Anyways a pattern like:
```
(simplify
(bit_and (bit_xor @0 @1) (bit_xor @0 @2))