https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83210
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Liu Hao from comment #4) > (In reply to Andrew Pinski from comment #2) > > (res >> 3) != src; > > > > Why not just (src>>(sizeof (res)*8-3))!=0. > > > > Seems shorter and might be faster. > > What if the second operand is not a power of 2? `(res * 5 / 5 != src)` will > always work, but bitwise shifting might not. Division is something we need to avoid. If any of the * 5 or / 5 ends up being actual multiplication, it doesn't make sense either. And otherwise it will just be very long. So the only thing that IMHO makes sense is unsigned overflow multiply with constant power of two. I can handle that. No plans to do anything else.