https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87287
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- With the to be posted patch, f1 and f3 remains the same, f2 and f4 improves: - movl %edi, %eax - sarl $31, %eax - shrl $28, %eax - addl %eax, %edi + xorl %eax, %eax andl $15, %edi - cmpl %eax, %edi setne %al - movzbl %al, %eax for f2 and - movl %edi, %eax - sarl $31, %eax - shrl $28, %eax - addl %eax, %edi andl $15, %edi - cmpl %eax, %edi je .L9 for f4 at -O2.