From patchwork Mon Sep 9 15:44:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 173396 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp4536617ilq; Mon, 9 Sep 2019 08:48:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUXFnsX4E9UORX2lD3vFLcEOcf3BMR3144sbJrulU/5OmV1EFPXPXrXYbhJmUVxUQzQSFH X-Received: by 2002:aa7:df1a:: with SMTP id c26mr24768471edy.106.1568044114724; Mon, 09 Sep 2019 08:48:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568044114; cv=none; d=google.com; s=arc-20160816; b=DMLYgpS9gJkYV8wjtYOkOrOkYieQprrNP6CWWPXw89THsq2qqI1ZDYznIv+7C5D99j 9ApoI8RJcNmv19Cex2oJHEFJCL07lC6U/SYqu/lCQiVAyE0HG+A8qoRfhWzl4CWGYtan 9ne+AfH3dutVD+AyxJxMrcpmXXMkjSW7iY731CsbRqeHHu1WlcTfcaEIk+MQ/eJjAbB1 fsZeui8ZdZOeQ9yss3kxwzeHTBLdswfqi+lr1kEEmBHIMLOhpx+F+/0fSGHCy+0pyMmk YSyuJYvjO8EO4j6aKjbIk40PUqGfgqEw58nMyXpToFPlcpFbPzm0QXeMLzA1ww9H4Vzp Wt/w== 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=SxKKe98Y2GYALZtAEgj0v4RtmnDno7TAQiGjNsJrIOo=; b=mq6Bh1AdseqVryGnjpangp6gRZbFl2BWu8t1extHRSppucvAQ5fT9jkfU2Aa85Fu2x ZAQOl7X95dy2FXBLnaH/fN5gT+em1hVzd1vjm/qm9P2b2HXKwGxOJAL7t/b/CRKxcERW tj3PycVZRnIAJ8MYyhZshq0Q2iJdojE8Y0wUxb3SloouJ02YWIlcF+sFWDw3OEOU4SLs JhdQ2tNILXd23j0NvLgsM+RoFnC4n/79qQiydgReNFoEeX4ya5dZt/sRU3rg6kQw9O0f ri6mdj9ttHl+SvmvUb6jtq2UHR8ZFArrQrFcYvrjWgtL9PpKURGZSnUPxVcKTAo+JUg4 JYkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=CxEkP2J2; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="D/5z/hju"; spf=pass (google.com: domain of gcc-patches-return-508649-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508649-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 g13si7413706ejp.264.2019.09.09.08.48.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Sep 2019 08:48:34 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-508649-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=CxEkP2J2; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="D/5z/hju"; spf=pass (google.com: domain of gcc-patches-return-508649-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom="gcc-patches-return-508649-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=fDL hyPNcRGYAe7jMnhciCI6BfuiG4InVhESY1koUIFMXad5f0hVwgeRV/1qrDnp7uFe Xz3m014FmHWFMBi4dPMUvpi6BPFUray/pkamB24pasILYxqJMOh3Pr7hi4W2sEtP 8jkpoe5wcnUq/omklN9tgRgIadSsJSxGGtB0Ls7w= 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=IKx+bANwj /12HV9mnDLvqrlqj7s=; b=CxEkP2J2WFBuiwwaNfFE++/6HIxqYNlzkuMurD1Sz 6IbWNhyYMw1gr/6escPd0MLNtJ2XH7RISsweUecjHuaK4iPIRaZKYGlDGB+YKVzX XDo9XdzUsjDSq1qbihItuv90NvufmiWj4GfbLdrMrOnfjF1I8Z1+dRBPL1Gk+aMs Gs= Received: (qmail 119753 invoked by alias); 9 Sep 2019 15:48:05 -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 119735 invoked by uid 89); 9 Sep 2019 15:48:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 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; Mon, 09 Sep 2019 15:48:02 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x89FkGL6003551 for ; Mon, 9 Sep 2019 17:48:00 +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=SxKKe98Y2GYALZtAEgj0v4RtmnDno7TAQiGjNsJrIOo=; b=D/5z/hjuAwxE7x3hG1BQ87hzomQCLTVFcygSlbHTf9mMUc2sLLUV6oWesOEZrL7jSdId Z4BOhxfofLR5UcXwXZVCk+NgZCEgmjjibLyA/59JDIRL7gsXP8wHb/X9QTrdr9kwpibu ebNXBfALWin1UZM9UxaUidaVw1+o7I5GYvrN6tVke2WUg+Vrz7U7wAlOxQ5/gEtmXFLU kWedNopaYxs0kjdKUJ0EXFMUiSxsyP8VtHMg+3FDhHmKAnE++2FMkOZWCIbizWJDHb8m UbYsGpAJp7lyCbFmq+vUEe2jr8/dVEWTdeT3IASGq5a1E9wXLkcyzVyssO1kbv2WY75k AQ== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx08-00178001.pphosted.com with ESMTP id 2uv1pa70mm-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 09 Sep 2019 17:48:00 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 4854A24 for ; Mon, 9 Sep 2019 15:47:57 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node1.st.com [10.75.127.13]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 73FEA2B9BE2 for ; Mon, 9 Sep 2019 17:47:54 +0200 (CEST) Received: from gnb.st.com (10.75.127.46) by SFHDAG5NODE1.st.com (10.75.127.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 9 Sep 2019 17:47:54 +0200 From: Christophe Lyon To: Subject: [ARM/FDPIC v6 07/24] [ARM] FDPIC: Avoid saving/restoring r9 on stack since it is read-only Date: Mon, 9 Sep 2019 17:44:49 +0200 Message-ID: <20190909154526.11630-8-christophe.lyon@st.com> In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com> References: <20190909154526.11630-1-christophe.lyon@st.com> MIME-Version: 1.0 X-IsSubscribed: yes From: Christophe Lyon 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 c34aab8..6ff3001 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -19571,9 +19571,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; } @@ -19605,9 +19603,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 e404e2c..490d22d 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -1960,6 +1960,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. */