https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64309
--- Comment #13 from rguenther at suse dot de <rguenther at suse dot de> --- On December 15, 2014 10:11:13 PM CET, "glisse at gcc dot gnu.org" <gcc-bugzi...@gcc.gnu.org> wrote: >https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64309 > >--- Comment #12 from Marc Glisse <glisse at gcc dot gnu.org> --- >(In reply to Marc Glisse from comment #11) >> ((pow2<<p)&(pow2<<n))!=0 -> p==n > >Oups, it wasn't supposed to be the same power of 2, so: >(((1<<k)<<p)&((1<<l)<<n))!=0 -> p==n+(l-k) >(k and l are constants) As others noted the transforms are only generally beneficial if they feed comparisons. Otherwise we may of course want to find a canonical form, but possibly that shouldn't be a comparison unless expansion knows how to undo this and rewrite them as bit operation. Richard.