There's no need to explicitly check for the maximum value, because the function we call handles it correctly anyway. libstdc++-v3/ChangeLog: PR libstdc++/98226 * include/std/bit (__countl_one, __countr_one): Remove redundant branches. Tested powerpc64le-linux. Committed to trunk.