From patchwork Tue Oct 19 21:36:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Tjernlund X-Patchwork-Id: 68383 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id DBFFFB6EED for ; Wed, 20 Oct 2010 08:36:56 +1100 (EST) Received: (qmail 6764 invoked by alias); 19 Oct 2010 21:36:53 -0000 Received: (qmail 6509 invoked by uid 22791); 19 Oct 2010 21:36:51 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from gw1.transmode.se (HELO gw1.transmode.se) (213.115.205.20) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 Oct 2010 21:36:45 +0000 Received: from sesr04.transmode.se (sesr04.transmode.se [192.168.201.15]) by gw1.transmode.se (Postfix) with ESMTP id 52B442597DB for ; Tue, 19 Oct 2010 23:36:42 +0200 (CEST) Received: from gentoo-jocke.transmode.se ([192.168.1.15]) by sesr04.transmode.se (Lotus Domino Release 8.5.2 HF23) with ESMTP id 2010101923364235-21435 ; Tue, 19 Oct 2010 23:36:42 +0200 Received: from gentoo-jocke.transmode.se (gentoo-jocke.transmode.se [127.0.0.1]) by gentoo-jocke.transmode.se (8.14.4/8.14.0) with ESMTP id o9JLagd5024789; Tue, 19 Oct 2010 23:36:42 +0200 Received: (from jocke@localhost) by gentoo-jocke.transmode.se (8.14.4/8.14.4/Submit) id o9JLagjA024788; Tue, 19 Oct 2010 23:36:42 +0200 From: Joakim Tjernlund To: gcc-patches@gcc.gnu.org Cc: Joakim Tjernlund Subject: [PATCH] PowerPC: Add msingle-pic-base option. Date: Tue, 19 Oct 2010 23:36:38 +0200 Message-Id: <1287524198-24754-1-git-send-email-Joakim.Tjernlund@transmode.se> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Do not generate fPIC/fpic prologue nor save and restore PIC register. Signed-off-by: Joakim Tjernlund --- Didn't get any reaction on gcc ML so trying here. rs6000.c | 4 ++++ rs6000.opt | 4 ++++ 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 5e6f301..71d095d 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -16036,8 +16036,10 @@ return ((df_regs_ever_live_p (reg) && (!call_used_regs[reg] || (reg == RS6000_PIC_OFFSET_TABLE_REGNUM - && TARGET_TOC && TARGET_MINIMAL_TOC))) + && TARGET_TOC && TARGET_MINIMAL_TOC + && !TARGET_SINGLE_PIC_BASE))) || (reg == RS6000_PIC_OFFSET_TABLE_REGNUM + && !TARGET_SINGLE_PIC_BASE && ((DEFAULT_ABI == ABI_V4 && flag_pic != 0) || (DEFAULT_ABI == ABI_DARWIN && flag_pic)))); } @@ -16721,6 +16723,9 @@ insn = emit_insn (generate_set_vrsave (reg, info, 0)); } + if (TARGET_SINGLE_PIC_BASE) + return; /* Do not set PIC register */ + /* If we are using RS6000_PIC_OFFSET_TABLE_REGNUM, we need to set it up. */ if ((TARGET_TOC && TARGET_MINIMAL_TOC && get_pool_size () != 0) || (DEFAULT_ABI == ABI_V4 diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/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