[Bug target/102107] protocol register (r12) corrupted before a tail call

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Sep 21 23:47:49 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102107

--- Comment #20 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Segher Boessenkool
<segher@gcc.gnu.org>:

https://gcc.gnu.org/g:5a989ccd3cbc31cb0e5fecd9423fc1577f3694b0

commit r10-10143-g5a989ccd3cbc31cb0e5fecd9423fc1577f3694b0
Author: Segher Boessenkool <segher@kernel.crashing.org>
Date:   Thu Sep 2 16:38:24 2021 +0000

    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.

    (cherry picked from commit 2484f7a4b0f52e6ed04754be336f1fa6fde47f6b)


More information about the Gcc-bugs mailing list