Consider: unsigned int bar (void); void foo (void) { unsigned int a = bar (); a >>= 2; if (a == 0) bar (); } ./cc1 -quiet -O2 -m5200 -fomit-frame-pointer generates foo: move.l %a2,-(%sp) lea bar,%a2 jbsr (%a2) lsr.l #2,%d0 tst.l %d0 jbne .L4 jbsr (%a2) .L4: move.l (%sp)+,%a2 rts Note that tst.l is not necessary because lsr.l sets the zero flag correctly. See notice_update_cc and its frequent use of CC_STATUS_INIT.
Confirmed, isn't it better just to convert m68k to a non cc0 target?
This was fixed by the cond-optab merge. The redundant tst instruction is no longer generated.