We cannot use r12 here, it is already in use as the GEP (for sibling
calls).
2021-09-08 Segher Boessenkool <segher@kernel.crashing.org>
PR target/102107
* config/rs6000/rs6000-logue.c (rs6000_emit_epilogue): For ELFv2 use
r11 instead of r12 for restoring CR.
else if (REGNO (frame_reg_rtx) == 12)
cr_save_regno = 11;
+ /* For ELFv2 r12 is already in use as the GEP. */
+ if (DEFAULT_ABI == ABI_ELFv2)
+ cr_save_regno = 11;
+
cr_save_reg = load_cr_save (cr_save_regno, frame_reg_rtx,
info->cr_save_offset + frame_off,
exit_func);