From patchwork Fri Nov 16 15:47:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 151355 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp587721ljp; Fri, 16 Nov 2018 07:50:55 -0800 (PST) X-Google-Smtp-Source: AJdET5cmNXsBcPR4DOL/IOogcTA/DXGI6bDfrvhbrlBZDvRsmPEkMQnHdSbm2dEPUghM2VeuE79W X-Received: by 2002:a62:114c:: with SMTP id z73-v6mr11405522pfi.192.1542383454943; Fri, 16 Nov 2018 07:50:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542383454; cv=none; d=google.com; s=arc-20160816; b=a2Hbi5UGfQ9W2P4BmxomVM5xCrYq6iQyEm+CA3QBR8Kg9Ta9zTjJgruHVAmoMPjCtn DhD21jBMtIsxApIANw4p7mdfDG4y2c2b1kqDbEsygLmyATqGYItq+u6lSY1lINtOB8LK YcBWdL3QcWAVEDbQ5KBiC7b4Jb8N1G8Wyj1B7vrLInIrOGKfuldp/2fpLHs8b1GKICWi HA0K6+LBgbqPcP9/z7Mxyow9rj92M0uIUQol5rZmi2iaMBCDM0unqgVgrUu+I02mKmsS G5ZfVkjbd8GLlaGULPyMzmpQjtDyRanH2+sl9VlS7Npxx01rr7EnxMmnAM/JDbqANWVY 4PSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature; bh=DoOplgRwLWcxdaybOaJYQAZ/032SIA92JMlAg8Rxryk=; b=rR6CHOTovexz8Qxre0AxDJgzX/doPxLZHbDsYYSqnA4azLXFGtf5cE53Ols9+RGy91 Tj34iAFKxhgZMCvLBGv49msi+VIT0govfCy2AVYXVl0UclV2Nh7NOqVQprzl99iUFOxu OH1LtkxJPLcR2Say+PfPtgXOA+TU9iavsfZz9GY4/Dg+evUs9TsKMINnXzpceI+esmiv LpdgleJBl5jW5WX+UxVMlHUVGlKtfkqHjowxErOUhB+Jq+7VRER7VlK2bw4EfDiRD/vk hEefPOVe0g+ImgYq2St5XCgtZGCM5yDXTle/BK834nd+7UK9C+22HIckjza2K0jXtcgm NKvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=gChOhnAX; spf=pass (google.com: domain of gcc-patches-return-490269-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490269-patch=linaro.org@gcc.gnu.org" Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id b22-v6si35960327pff.192.2018.11.16.07.50.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 07:50:54 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-490269-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=gChOhnAX; spf=pass (google.com: domain of gcc-patches-return-490269-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-490269-patch=linaro.org@gcc.gnu.org" DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=LXQ3el3JOH8cwc6d2y/5RUPK+rjO4+RJHvWpYt4pJJ34OHGnkKGFh PuATAQGjlWEgcy0g4Bzi+lxdI0CombDL84jQB/cGNosARlXc+WgJwaMExwlReDkk pEpg0cuK4JMb/uDB5jQ4OJSWjxXk14ktPc1kkGiJfMY+mSeZEm93lM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=default; bh=EY3Lwdol7UFgRfjACdUT5mTasCw=; b=gChOhnAX35Lyo821oatT8/RdNzuc b7NVNx9kyUCZBI084QNyv5IZBoSmn7bv1yYNCut15JvLpofQZpqE0eP8Tv2kxHCK luGeT4lmeTIZvrMvITiLZqQGJy7VqwhsAe0T/OFowqqvPg8zTrP8CmilykojfhKp 1yn3i8oCKfv9KlQ= Received: (qmail 118825 invoked by alias); 16 Nov 2018 15:50:39 -0000 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 Received: (qmail 117731 invoked by uid 89); 16 Nov 2018 15:50:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx07-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (62.209.51.94) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Nov 2018 15:50:37 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wAGFikRu002137; Fri, 16 Nov 2018 16:50:35 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2nsx068w6c-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Nov 2018 16:50:35 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id E3D0634; Fri, 16 Nov 2018 15:50:34 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CB7A45015; Fri, 16 Nov 2018 15:50:34 +0000 (GMT) Received: from gnb.st.com (10.75.127.45) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 16 Nov 2018 16:50:34 +0100 From: Christophe Lyon To: CC: Subject: [ARM/FDPIC v4 07/20] [ARM] FDPIC: Avoid saving/restoring r9 on stack since it is read-only Date: Fri, 16 Nov 2018 16:47:35 +0100 Message-ID: <20181116154808.25154-8-christophe.lyon@st.com> In-Reply-To: <20181116154808.25154-1-christophe.lyon@st.com> References: <20181116154808.25154-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes 2018-XX-XX Christophe Lyon Mickaël Guêné gcc/ * config/arm/arm.h (PIC_REGISTER_MAY_NEED_SAVING): New helper. * config/arm/arm.c (arm_compute_save_reg0_reg12_mask): Handle FDPIC. Change-Id: I0f3b2023ab2a2a0433dfe081dac6bbb194b7a76c -- 2.6.3 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 63c68e5..7e7f747 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -19480,9 +19480,7 @@ arm_compute_save_reg0_reg12_mask (void) save_reg_mask |= (1 << reg); /* Also save the pic base register if necessary. */ - if (flag_pic - && !TARGET_SINGLE_PIC_BASE - && arm_pic_register != INVALID_REGNUM + if (PIC_REGISTER_MAY_NEED_SAVING && crtl->uses_pic_offset_table) save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM; } @@ -19514,9 +19512,7 @@ arm_compute_save_reg0_reg12_mask (void) /* If we aren't loading the PIC register, don't stack it even though it may be live. */ - if (flag_pic - && !TARGET_SINGLE_PIC_BASE - && arm_pic_register != INVALID_REGNUM + if (PIC_REGISTER_MAY_NEED_SAVING && (df_regs_ever_live_p (PIC_OFFSET_TABLE_REGNUM) || crtl->uses_pic_offset_table)) save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM; diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index 53c3b0e..35a2bd2 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1949,6 +1949,13 @@ extern unsigned arm_pic_register; || label_mentioned_p (get_pool_constant (X))))) \ || tls_mentioned_p (X)) +/* We may want to save the PIC register if it is a dedicated one. */ +#define PIC_REGISTER_MAY_NEED_SAVING \ + (flag_pic \ + && !TARGET_SINGLE_PIC_BASE \ + && !TARGET_FDPIC \ + && arm_pic_register != INVALID_REGNUM) + /* We need to know when we are making a constant pool; this determines whether data needs to be in the GOT or can be referenced via a GOT offset. */