]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
fix PR target/88343 for 32b powerpc.
authorIain Sandoe <iain@sandoe.co.uk>
Sun, 30 Dec 2018 13:20:19 +0000 (13:20 +0000)
committerIain Sandoe <iains@gcc.gnu.org>
Sun, 30 Dec 2018 13:20:19 +0000 (13:20 +0000)
2018-12-30  Iain Sandoe  <iain@sandoe.co.uk>

backport from mainline.
2018-12-12 Segher Boessenkool  <segher@kernel.crashing.org>
   Iain Sandoe  <iain@sandoe.co.uk>

PR target/88343
* config/rs6000/rs6000.c (save_reg_p): Do not save the picbase reg
unless it has been used.
(first_reg_to_save): Remove dead code.

From-SVN: r267477

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index f208bbcc3b09fc34643f60faf574ab884ecc437c..5d1bf431b41cd48b13b1cf77763d7c457ec9190e 100644 (file)
@@ -1,3 +1,14 @@
+2018-12-30  Iain Sandoe  <iain@sandoe.co.uk>
+
+       backport from mainline.
+       2018-12-12 Segher Boessenkool  <segher@kernel.crashing.org>
+                  Iain Sandoe  <iain@sandoe.co.uk>
+
+       PR target/88343
+       * config/rs6000/rs6000.c (save_reg_p): Do not save the picbase reg
+       unless it has been used.
+       (first_reg_to_save): Remove dead code.
+
 2018-12-24  Iain Sandoe  <iain@sandoe.co.uk>
 
        Backport from mainline
index 68dd95429fe683a7445e7857e540f2619a07514a..df5e0ef41a61bdb67b58667e8184454698f3bd37 100644 (file)
@@ -26738,7 +26738,7 @@ rs6000_reg_live_or_pic_offset_p (int reg)
        return true;
 
       if ((DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_DARWIN)
-         && flag_pic)
+         && flag_pic && crtl->uses_pic_offset_table)
        return true;
     }
 
@@ -26769,13 +26769,6 @@ first_reg_to_save (void)
       && rs6000_reg_live_or_pic_offset_p (RS6000_PIC_OFFSET_TABLE_REGNUM))
     first_reg = RS6000_PIC_OFFSET_TABLE_REGNUM;
 
-#if TARGET_MACHO
-  if (flag_pic
-      && crtl->uses_pic_offset_table
-      && first_reg > RS6000_PIC_OFFSET_TABLE_REGNUM)
-    return RS6000_PIC_OFFSET_TABLE_REGNUM;
-#endif
-
   return first_reg;
 }