Consider: unsigned int bar (void); void foo (void) { unsigned int a = bar (); if (a <= 3) bar (); } ./cc1 -quiet -O2 -fomit-frame-pointer generates foo: move.l %a2,-(%sp) lea bar,%a2 jbsr (%a2) moveq #3,%d1 cmp.l %d0,%d1 jbcs .L4 jbsr (%a2) .L4: move.l (%sp)+,%a2 rts Note that moveq #3,%d1 cmp.l %d0,%d1 jbcs .L4 can be replaced with lsr.l #2,%d0 jbne .L4 This bug depends on PR 25113 because GCC needs to know that lsr.l sets the zero flag correctly.
Confirmed.
Fixed on the trunk.