https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94913
--- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> --- Created attachment 48458 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48458&action=edit Prototype patch Prototype patch for missed optimization, described in Comment #0. Following testcase: --cut here-- int foo (unsigned int x, unsigned int y) { return ~x < y; } void f1 (void); void f2 (void); void bar (unsigned int x, unsigned int y) { if (~x < y) f1 (); else f2 (); } --cut here-- compiles (-O2) to: foo: xorl %eax, %eax addl %esi, %edi setc %al ret bar: addl %esi, %edi jnc .L4 jmp f1 .L4: jmp f2