On Mon, May 27, 2024 at 05:31:16PM +0100, Al Viro wrote: > Hell knows; let me play with that a bit and let's see what falls out... gcc optimizer is... interesting: if (v & 1) if (!(v & 3)) foo(); is *NOT* collapsed into a no-op. Not even if (v & 1) if (!(v & 1) && !(v & 2)) foo(); is good enough for it. if (v & 1) if (!(v & 1)) if (!(v & 2)) foo(); is recognized, thankfully, but... WTF? As far as I can tell, if (!(v & 1) && !(v & 2)) gets turned into if (!(v & 3)), and then gcc gets stuck on that. if (!(v & 1)) if (!(v & 2)) is turned into the same, but apparently only after it actually looks at both parts in context of what it knows about the earlier checks. clang handles all forms just fine, but gcc does not ;-/