From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1698) id B5BC93858C53; Thu, 14 Apr 2022 05:25:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B5BC93858C53 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Iain D Sandoe To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-9868] Darwin, PPC : Fix R13 for PPC64. X-Act-Checkin: gcc X-Git-Author: Iain Sandoe X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 916814832ab8d91c15b790c97dd5e382a4e8c229 X-Git-Newrev: 1dcb779ece80e7eb31d4e9162ce1d626dee70b4f Message-Id: <20220414052519.B5BC93858C53@sourceware.org> Date: Thu, 14 Apr 2022 05:25:19 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2022 05:25:19 -0000 https://gcc.gnu.org/g:1dcb779ece80e7eb31d4e9162ce1d626dee70b4f commit r11-9868-g1dcb779ece80e7eb31d4e9162ce1d626dee70b4f Author: Iain Sandoe Date: Fri Dec 11 00:29:42 2020 +0000 Darwin, PPC : Fix R13 for PPC64. We have a somewhat unusual situation in that for PPC64, R13 is both reserved and callee-saved (it is used internally by the pthreads implementation to contain pthread_self). So add R13 to the fixed regs, but also keep it in the callee- saved set. gcc/ChangeLog: * config/rs6000/darwin.h (FIXED_R13): Add for PPC64. (FIRST_SAVED_GP_REGNO): Save from R13 even when it is one of the fixed regs. (cherry picked from commit b12d6e79899fd27833c53ffc3c973538244f62e1) Diff: --- gcc/config/rs6000/darwin.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h index 42f39e60305..566794af706 100644 --- a/gcc/config/rs6000/darwin.h +++ b/gcc/config/rs6000/darwin.h @@ -203,7 +203,7 @@ /* Make both r2 and r13 available for allocation. */ #define FIXED_R2 0 -#define FIXED_R13 0 +#define FIXED_R13 TARGET_64BIT /* Base register for access to local variables of the function. */ @@ -213,6 +213,9 @@ #undef RS6000_PIC_OFFSET_TABLE_REGNUM #define RS6000_PIC_OFFSET_TABLE_REGNUM 31 +#undef FIRST_SAVED_GP_REGNO +#define FIRST_SAVED_GP_REGNO 13 + /* Darwin's stack must remain 16-byte aligned for both 32 and 64 bit ABIs. */