From patchwork Wed May 15 12:39:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 164282 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp604015oca; Wed, 15 May 2019 05:42:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxY1RU7CsT+z4VrP54HRLr1YeRfvVN8ddIIZ2T5p9M3lf/6UH1LcjtiLlOjqPAP9cMYUWJ2 X-Received: by 2002:a17:902:ab98:: with SMTP id f24mr42659806plr.223.1557924171425; Wed, 15 May 2019 05:42:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557924171; cv=none; d=google.com; s=arc-20160816; b=JkY3COYATJMn32mWXg00JWQrquPAtN8vOnyBWEULhfZ/JvKpRBkKdtVS3zSmTaPHVV DNJfZBlTZbQs/giu8yY51OAlcuxm8H/T066TvbXuDQl8T0uA/qUwTsxi1qa69i+E/1yZ 3C4wUipYlrcVU9oVFukh8Lr2fPDY+Kex/fNRIZQnGdamDg8WE3hLQEGY4A5o8ssO2xdU TZmVmEH3l+uz8p8IVvZvMapf8dY3Zk6K76/XDAYI3todT8n5aOGc/eJK4dh5ElqhEo7T 0abLoF2+id1eQW43wjDYLOwznC9Hf+izQEIussjUY2t7hO7wo4V+UKYVplMNSpCQKTOO p/nQ== 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:to:from:dkim-signature:delivered-to:sender :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mailing-list:dkim-signature:domainkey-signature; bh=a5TMQAnew7zN/mIlQfeVb+dddY5xvbZ4gU0Eq5Morb0=; b=MSrPPrj/yVTwmDUq3/iGkAJXztfChkpZmmVwzrpVuUskzyjjznVbmqJEkIhfQt/94M ykAjqdaDfd5CHLaS6nafXVyr073s5kZPDjzU+HWsiCF1j1h5RByzEdrA+EyDYu2ObWQ5 KqD+xpE8tejuJX3UuOslpGmBqFLkizzd/DFq8Em4BaqU9VpMbcwI8ki+HQU7EVGewoxg BUgmqh2b14sbRqlo7cXyH0eKk1f27273l4OlL3EDyz/GHv72G1+McC8NyTq8GH3JQ6xK /BglkI5c2UCZ4VawN4Xo/x145HVoAGAHsAv86iU9jZuHWr415jb0PNjqvek5Ec8YM5aU q2dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Kw+ZwWAO; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=FgckDIGN; spf=pass (google.com: domain of gcc-patches-return-500771-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500771-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 d34si1869801pgd.558.2019.05.15.05.42.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 May 2019 05:42:51 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-500771-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=Kw+ZwWAO; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=FgckDIGN; spf=pass (google.com: domain of gcc-patches-return-500771-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-500771-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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=AB9 9bGjkj0gK8EfFF5hPeR9Gyt4lzoxGZpnxvi01xl4cf/nq0LUEzcFKOJZtfxviPxC 0GnY2WiSOF/GKpT3hT2LK/a0dMu2rPEGsJdszt6AYgkj7C2dstcp5IOYSdeQo+wt E3O0J+oAnyLojE1H5btM3EwOCWsxTK3/9T3mw2JI= 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:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=default; bh=CyrwNDF8f 3G0jvM3rQGiXKvkHPg=; b=Kw+ZwWAO9+U40o5Y0A+o26s2nlgMVHJKdRawuB2BP tJ19VuzYgpNy6YUUd04hogcfOefyB+AxbMOawUjCnknV4ksmuihyCac2L11XFhVV Bx1O+0ceHHnxxcHeyWSneTtk3opUIu/wj/wp4TsYrW9NWkCS8jQLaP8bCyfdRLlN LY= Received: (qmail 76690 invoked by alias); 15 May 2019 12:42:40 -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 76303 invoked by uid 89); 15 May 2019 12:42:40 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.5 required=5.0 tests=AWL, 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.1 spammy= X-HELO: mx07-00178001.pphosted.com Received: from mx08-00178001.pphosted.com (HELO mx07-00178001.pphosted.com) (91.207.212.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 May 2019 12:42:38 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4FCfqRs022149 for ; Wed, 15 May 2019 14:42:36 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=a5TMQAnew7zN/mIlQfeVb+dddY5xvbZ4gU0Eq5Morb0=; b=FgckDIGNGPQKa14Lok3dKHErWN7weCYRqX2pjP6GKK8R2lWixDX3znxtwuZrjCSOyejL 2byymDHz+OWwSq0VV5B2ZeuhX709UxA5xX0OeCA/tQ6fpy18MWXDUG+0DKCos0hIPOBS 9kNjO/shC3kWyRk6LpMG8Ko+08+1vv8dR/quYsScWHARlO/aZeg3XN91jnwmhqwHzJ9V EY1Y2wjhxNfQBGA6NS89b2gEu7PyTjhnc3VDdswfa9wG3aeOWxo5CJCpkrFuC8H4dziY og1zLEkXoLCqk0nHgU4wuj5Hm+1Fo4OMIrfFNPfttlJUDtt8HuaDWThvadyzz2zECD5K Nw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2sek5ajrc4-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 15 May 2019 14:42:36 +0200 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 2AA7938 for ; Wed, 15 May 2019 12:42:36 +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 19BCD2757 for ; Wed, 15 May 2019 12:42:36 +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; Wed, 15 May 2019 14:42:35 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v5 07/21] [ARM] FDPIC: Avoid saving/restoring r9 on stack since it is read-only Date: Wed, 15 May 2019 14:39:32 +0200 Message-ID: <20190515124006.25840-8-christophe.lyon@st.com> In-Reply-To: <20190515124006.25840-1-christophe.lyon@st.com> References: <20190515124006.25840-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes 2019-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 d9397b5..dbd1671 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -19651,9 +19651,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; } @@ -19685,9 +19683,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 7b50ef5..45c0e2b 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1967,6 +1967,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. */