https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49244
--- Comment #10 from dhowells at redhat dot com <dhowells at redhat dot com> --- A partial optimisation could be made if the mask is constant and only contains one bit (or/xor) or only lacks one bit (and). That is the most common case in the kernel by far, but it would still leave instances where the bit number is dynamic.