https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70123
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Ah, the spilled value is pseudo 240, which holds &b. Dunno why instead of spilling it it couldn't be rematerialized. Anyway, the value in r6 after the f9 call is needed, so all that seems to be wrong is the order of the instructions after the f9 call: stg %r6,192(%r15) ! The spill of &b lgf %r4,252(%r15) larl %r3,.LC6 lghi %r2,1 lgr %r6,%r10 ! %r10 holds g value, copy it into argument reg lghi %r11,0 brasl %r14,bar@PLT ! bar shouldn't clobber %r6 stg %r8,168(%r15) stg %r9,160(%r15) lgr %r4,%r10 lghi %r5,1 lghi %r3,3 lg %r2,280(%r15) brasl %r14,f9@PLT ! nor f9; and f9 takes it as g as its 3rd ! and 5th arg; so in %r4 and %r6, %r4 is call clobbered, %r6 and %r10 are ! call-saved lg %r6,192(%r15) ! this fills the &b value lgr %r10,%r6 ! but, here we want the g value instead; ! That value is live in both %r6 before the above fill, or in %r10 as well. ! So either removing the lgr %r10,%r6 instruction, or moving it before ! lg %r6,192(%r15) instruction fixes the testcase.