https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88402
Bug ID: 88402 Summary: inefficient code generation for mask from CC Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org Target Milestone: --- For sth like unsigned long foo (int a, int b) { return a < b ? -1ul : 0; } we produce at -O[23] xorl %eax, %eax cmpl %esi, %edi setl %al negq %rax ret (partial register stall?) and at -O cmpl %esi, %edi setl %al movzbl %al, %eax negq %rax while we could use sbbq %rax, %rax if the suggestion at https://lwn.net/Articles/744257/ is correct.