https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70087
David Malcolm <dmalcolm at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dmalcolm at gcc dot gnu.org --- Comment #3 from David Malcolm <dmalcolm at gcc dot gnu.org> --- FWIW, doing it as a switch leads to a branch also: int baz () { switch (at) { case 2: case 4: case 7: return 1; default: return 0; } } baz: .LFB2: .cfi_startproc movl at(%rip), %ecx xorl %eax, %eax cmpl $7, %ecx ja .L7 movl $1, %eax salq %cl, %rax testb $-108, %al setne %al .L7: movzbl %al, %eax ret .cfi_endproc where switchconv printed "expanding as bit test is preferable".