From 24f77f59d12ad05d8b0c1dc1faae4f698d12da3f Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 4 May 2016 22:53:58 +0930 Subject: [PATCH] [RS6000] Correct PIC_OFFSET_TABLE_REGNUM Leaving this as r30 results in pic_offset_table_rtx of (reg 30) for -m64, which is completely bogus. Various rtl analysis predicate functions treat pic_offset_table_rtx specially.. * config/rs6000/rs6000.h (PIC_OFFSET_TABLE_REGNUM): Correct. From-SVN: r235876 --- gcc/ChangeLog | 1 + gcc/config/rs6000/rs6000.h | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a097aeef062..00440fc08c0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,6 @@ 2016-05-04 Alan Modra + * config/rs6000/rs6000.h (PIC_OFFSET_TABLE_REGNUM): Correct. * config/rs6000/sysv4.h (TARGET_TOC): Simplify. * config/rs6000/rs6000.c (rs6000_elf_output_toc_section_asm_op): Align .toc. diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index 12fa7275cdc..c89236a29ee 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -2058,7 +2058,10 @@ do { \ to allocate such a register (if necessary). */ #define RS6000_PIC_OFFSET_TABLE_REGNUM 30 -#define PIC_OFFSET_TABLE_REGNUM (flag_pic ? RS6000_PIC_OFFSET_TABLE_REGNUM : INVALID_REGNUM) +#define PIC_OFFSET_TABLE_REGNUM \ + (TARGET_TOC ? TOC_REGISTER \ + : flag_pic ? RS6000_PIC_OFFSET_TABLE_REGNUM \ + : INVALID_REGNUM) #define TOC_REGISTER (TARGET_MINIMAL_TOC ? RS6000_PIC_OFFSET_TABLE_REGNUM : 2) -- 2.30.2