https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89184
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> --- So in high level terms (let's not do asm when we don't need to), you want ((i >> 1) & 3) == 2 replaced with i & (3 << 1) == (2 << 1) (as long as (i>>1) and (i>>1)&3 are not used for anything else) That makes sense.