[Bug tree-optimization/102486] __builtin_popcount(y&-y) is not optimized to y!=0

2023-10-25 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102486

--- Comment #3 from Andrew Pinski  ---
Rather:
```
int f2(unsigned y)
{
  return (y&-y) != 0;
}
```

[Bug tree-optimization/102486] __builtin_popcount(y&-y) is not optimized to y!=0

2021-09-26 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102486

--- Comment #2 from Andrew Pinski  ---
(In reply to Luc Van Oostenryck from comment #1)
> when y != 0

Right. So it should be optimize to y!=0 then.