Michael Meissner <meiss...@linux.vnet.ibm.com> wrote on 2010/10/07 20:21:38:
>
> On Thu, Oct 07, 2010 at 04:50:50PM +0200, Joakim Tjernlund wrote:
> > Why not offer some of this on PowerPC32? mcmodel=small would probably be 
> > enough.
>
> Well as they say, contributions are welcome.  Note, 32-bit mode doesn't need

A first contribution, support msingle-pic-base on ppc.

>From b418def9575d6ea3698077888157ae52631e52f3 Mon Sep 17 00:00:00 2001
From: Joakim Tjernlund <joakim.tjernl...@transmode.se>
Date: Sat, 9 Oct 2010 12:45:39 +0200
Subject: [PATCH] PowerPC: Add msingle-pic-base option.

Do not generate PIC prolougue.
---
 rs6000.c   |    4 ++++
 rs6000.opt |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/rs6000.c b/rs6000.c
index 5e6f301..71d095d 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -15323,6 +15323,10 @@ void
 rs6000_emit_load_toc_table (int fromprolog)
 {
   rtx dest;
+
+  if (TARGET_SINGLE_PIC_BASE)
+    return; /* Do not set PIC register */
+
   dest = gen_rtx_REG (Pmode, RS6000_PIC_OFFSET_TABLE_REGNUM);

   if (TARGET_ELF && TARGET_SECURE_PLT && DEFAULT_ABI != ABI_AIX && flag_pic)
diff --git a/rs6000.opt b/rs6000.opt
index 8a62352..5f6e6ca 100644
--- a/gcc/config/rs6000/rs6000.opt
+++ b/gcc/config/rs6000/rs6000.opt
@@ -103,6 +103,10 @@ mold-mnemonics
 Target Report RejectNegative InverseMask(NEW_MNEMONICS)
 Use old mnemonics for PowerPC architecture

+msingle-pic-base
+Target Report Mask(SINGLE_PIC_BASE)
+Do not load the PIC register in function prologues
+
 msoft-float
 Target Report RejectNegative Mask(SOFT_FLOAT)
 Do not use hardware floating point
--
1.7.2.2

Reply via email to