https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96015
--- Comment #21 from Sergei Trofimovich <slyfox at inbox dot ru> --- (In reply to Eric Botcazou from comment #18) > If the control flow goes through .L12: > > .L12: > b .L3 ; return 0; (not interesting, fall through) > ldi 1,%r28 > > the return value will be 1 since ldi is in the delay slot of the branch. > > What happens if you compile with -O2 -fno-delayed-branch instead? Oh, -fno-delayed-branch makes test magically pass! Attaching both bad.S and good.S for comparison.