From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126465 invoked by alias); 31 Oct 2015 17:39:57 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 126455 invoked by uid 89); 31 Oct 2015 17:39:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_20,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: gcc1-power7.osuosl.org Received: from gcc1-power7.osuosl.org (HELO gcc1-power7.osuosl.org) (140.211.15.137) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 31 Oct 2015 17:39:55 +0000 Received: by gcc1-power7.osuosl.org (Postfix, from userid 10019) id 5F15B1C06BB; Sat, 31 Oct 2015 17:39:52 +0000 (UTC) From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com, Segher Boessenkool Subject: [PATCH 1/2] rs6000: Another PIC LRA fix Date: Sat, 31 Oct 2015 17:40:00 -0000 Message-Id: <7e54882ef262803dd1d2b9c36f1ecdaa5220edea.1446312596.git.segher@kernel.crashing.org> X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg03489.txt.bz2 This one for TARGET_TOC && TARGET_MINIMAL_TOC. Without it, r30 is not saved in the prologue for functions that do not use r30, but the register is set later in the prologue anyhow. This made all java tests fail. Tested on powerpc64-linux, --enable-languages=all,ada,go,obj-c++ and test variants {-m32/-mno-lra,-m32/-mlra,-m32/-mpowerpc64,-m64/-mno-lra,-m64/-mlra}; and on powerpc64le-linux, everything default. Both also with bootstrapping with LRA defaulted on. Okay for trunk? Segher 2015-10-31 Segher Boessenkool * config/rs6000/rs6000.c (rs6000_reg_live_or_pic_offset_p): Use the same condition for testing whether RS6000_PIC_OFFSET_TABLE_REGNUM is live as for using it elsewhere, for TARGET_MINIMAL_TOC. --- gcc/config/rs6000/rs6000.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 9610625..1c55244 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -21793,7 +21793,9 @@ rs6000_reg_live_or_pic_offset_p (int reg) || (reg == RS6000_PIC_OFFSET_TABLE_REGNUM && !TARGET_SINGLE_PIC_BASE && ((DEFAULT_ABI == ABI_V4 && flag_pic != 0) - || (DEFAULT_ABI == ABI_DARWIN && flag_pic)))); + || (DEFAULT_ABI == ABI_DARWIN && flag_pic) + || (TARGET_TOC && TARGET_MINIMAL_TOC + && get_pool_size () != 0)))); } /* Return the first fixed-point register that is required to be -- 1.9.3