rs6000: Don't use r12 for CR save on ELFv2 (PR102107)
authorSegher Boessenkool <segher@kernel.crashing.org>
Thu, 2 Sep 2021 16:38:24 +0000 (16:38 +0000)
committerSegher Boessenkool <segher@kernel.crashing.org>
Fri, 3 Sep 2021 21:04:23 +0000 (21:04 +0000)
commit2484f7a4b0f52e6ed04754be336f1fa6fde47f6b
tree81e221c51e4109e17eeea33f6498e3aba86eb05e
parentaddf167a23f61c0ec97f6e71577a0623f3fc13e7
rs6000: Don't use r12 for CR save on ELFv2 (PR102107)

CR is saved and/or restored on some paths where GPR12 is already live
since it has a meaning in the calling convention in the ELFv2 ABI.

It is not completely clear to me that we can always use r11 here, but
it does seem save, there is checking code (to detect conflicts here),
and it is stage 1.  So here goes.

2021-09-03  Segher Boessenkool <segher@kernel.crashing.org>

PR target/102107
* config/rs6000/rs6000-logue.c (rs6000_emit_prologue): On ELFv2 use r11
instead of r12 for CR save, in all cases.
gcc/config/rs6000/rs6000-logue.c