From patchwork Mon Aug 29 21:32:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Meissner X-Patchwork-Id: 112157 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 9A407B6F8E for ; Tue, 30 Aug 2011 07:33:13 +1000 (EST) Received: (qmail 4067 invoked by alias); 29 Aug 2011 21:33:11 -0000 Received: (qmail 4058 invoked by uid 22791); 29 Aug 2011 21:33:09 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, NO_DNS_FOR_FROM, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e36.co.us.ibm.com (HELO e36.co.us.ibm.com) (32.97.110.154) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 29 Aug 2011 21:32:53 +0000 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by e36.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p7TLQFhs016097 for ; Mon, 29 Aug 2011 15:26:15 -0600 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p7TLWlCD178808 for ; Mon, 29 Aug 2011 15:32:47 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p7TLWkDT031515 for ; Mon, 29 Aug 2011 15:32:46 -0600 Received: from hungry-tiger.westford.ibm.com (hungry-tiger.westford.ibm.com [9.33.37.78]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p7TLWkLR031450; Mon, 29 Aug 2011 15:32:46 -0600 Received: by hungry-tiger.westford.ibm.com (Postfix, from userid 500) id B5317F8426; Mon, 29 Aug 2011 17:32:45 -0400 (EDT) Date: Mon, 29 Aug 2011 17:32:44 -0400 From: Michael Meissner To: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com Subject: [PATCH, committed] Change default for powerpc -msave-toc-indirect Message-ID: <20110829213244.GA17151@hungry-tiger.westford.ibm.com> Mail-Followup-To: Michael Meissner , gcc-patches@gcc.gnu.org, dje.gcc@gmail.com MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 David asked me to reverse the default for the -msave-toc-indirect option, since it is buggy in a few cases, and in other places causes slowdowns if the function has an early exit before calling the indrect function. I also documented the switch. I did the usual bootstrap and make check with no regressions, and committed the patch. 2011-08-29 Michael Meissner * config/rs6000/rs6000.opt (-msave-toc-indirect): Change default to off. Document switch. * doc/invoke.texi (-msave-toc-indirect): Ditto. Index: gcc/config/rs6000/rs6000.opt =================================================================== --- gcc/config/rs6000/rs6000.opt (revision 178259) +++ gcc/config/rs6000/rs6000.opt (working copy) @@ -526,5 +526,5 @@ Target Report Var(TARGET_POINTERS_TO_NES Use/do not use r11 to hold the static link in calls to functions via pointers. msave-toc-indirect -Target Undocumented Var(TARGET_SAVE_TOC_INDIRECT) Save Init(1) -; Control whether we save the TOC in the prologue for indirect calls or generate the save inline +Target Report Var(TARGET_SAVE_TOC_INDIRECT) Save +Control whether we save the TOC in the prologue for indirect calls or generate the save inline Index: gcc/doc/invoke.texi =================================================================== --- gcc/doc/invoke.texi (revision 178259) +++ gcc/doc/invoke.texi (working copy) @@ -814,7 +814,8 @@ See RS/6000 and PowerPC Options. -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol -mno-recip-precision @gol -mveclibabi=@var{type} -mfriz -mno-friz @gol --mpointers-to-nested-functions -mno-pointers-to-nested-functions} +-mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol +-msave-toc-indirect -mno-save-toc-indirect} @emph{RX Options} @gccoptlist{-m64bit-doubles -m32bit-doubles -fpu -nofpu@gol @@ -16438,6 +16439,15 @@ static chain value to be loaded in regis not be able to call through pointers to nested functions or pointers to functions compiled in other languages that use the static chain if you use the @option{-mno-pointers-to-nested-functions}. + +@item -msave-toc-indirect +@itemx -mno-save-toc-indirect +@opindex msave-toc-indirect +Generate (do not generate) code to save the TOC value in the reserved +stack location in the function prologue if the function calls through +a pointer on AIX and 64-bit Linux systems. If the TOC value is not +saved in the prologue, it is saved just before the call through the +pointer. The @option{-mno-save-toc-indirect} option is the default. @end table @node RX Options