https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111252
--- Comment #5 from Xi Ruoyao <xry111 at gcc dot gnu.org> --- (In reply to Xi Ruoyao from comment #4) > Hmm, this seems a separate issue. The compiler knows to optimize (a & mask) > if mask is ((1 << a) - 1) << b iff a + b = 32 or b = 0, but not for any I mean "32 or 64". > other masks even if it's "expensive" to materialize the mask: