https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94042
--- Comment #21 from Martin Liška <marxin at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #20) > The return value of the first _Z11tsubst_exprP9tree_nodeS0_iS0_b.part.0 was > being copied into r8 and then copied back into r3 (return value), but not r0 > is used and that r0 is used for mtlr (moving back the return address). Yes, I can confirm the $r0 is screwed. The value is equal in good/bad binary at the beginning of the function: (gdb) p /x $r0 $37 = 0x1049a3dc good code stores: 0x104c9124 <._Z19tsubst_template_argP9tree_nodeS0_iS0_+100> std r0,144(r1) (gdb) p /x $r0 $38 = 0x104c9294 but the wrong one into a different memory address: (gdb) p /x $r0 $28 = 0x104c92a4 So yes, $r0 is used first here in bad version here: │0x104c90f4 <._Z19tsubst_template_argP9tree_nodeS0_iS0_+52> ld r0,0(r9)
