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

--- Comment #6 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Marek Polacek from comment #5)
> I don't think so.  I tried to come up with a more general transformation
> that would simplify ((CST << n) & CST) != 0, but I haven't found anything

If both CST are (possibly different) powers of 2 it works. ((c<<n)&c)==c also
works. ((pow2<<p)&(pow2<<n))!=0.

> yet.  So maybe just this?
> ((1 << n) & 1) != 0 -> n == 0

That looks like what richi posted. For scalars, != 0 is useless and this could
just be:
(1<<n)&1 -> n==0

> ((1 << n) & 1) == 0 -> n != 0

Reply via email to