From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90020 invoked by alias); 5 Sep 2018 11:50:56 -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 89908 invoked by uid 89); 5 Sep 2018 11:50:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.2 spammy=easiest X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Sep 2018 11:50:53 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fxWKh-0004Uc-5j for gcc-patches@gcc.gnu.org; Wed, 05 Sep 2018 07:50:52 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:45438) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fxWKg-0004RJ-UY for gcc-patches@gcc.gnu.org; Wed, 05 Sep 2018 07:50:51 -0400 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1fxWKg-0005ip-0t from Andrew_Stubbs@mentor.com for gcc-patches@gcc.gnu.org; Wed, 05 Sep 2018 04:50:50 -0700 Received: from build6-trusty-cs.sje.mentorg.com (137.202.0.90) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Wed, 5 Sep 2018 12:50:45 +0100 From: To: Subject: [PATCH 12/25] Make default_static_chain return NULL in non-static functions Date: Wed, 05 Sep 2018 11:50:00 -0000 Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.8.1" X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 X-SW-Source: 2018-09/txt/msg00275.txt.bz2 --------------2.8.1 Content-Type: text/plain; charset="UTF-8"; format=fixed Content-Transfer-Encoding: 8bit Content-length: 421 This patch allows default_static_chain to be called from the back-end without it knowing if the function is static or not. Or, to put it another way, without duplicating the check everywhere it's used. 2018-09-05 Tom de Vries gcc/ * targhooks.c (default_static_chain): Return NULL in non-static functions. --- gcc/targhooks.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --------------2.8.1 Content-Type: text/x-patch; name="0012-Make-default_static_chain-return-NULL-in-non-static-.patch" Content-Transfer-Encoding: 8bit Content-Disposition: inline; filename="0012-Make-default_static_chain-return-NULL-in-non-static-.patch" Content-length: 690 diff --git a/gcc/targhooks.c b/gcc/targhooks.c index afd56f3..742cfbf 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -1021,8 +1021,14 @@ default_internal_arg_pointer (void) } rtx -default_static_chain (const_tree ARG_UNUSED (fndecl_or_type), bool incoming_p) +default_static_chain (const_tree fndecl_or_type, bool incoming_p) { + /* While this function won't be called by the middle-end when a static + chain isn't needed, it's also used throughout the backend so it's + easiest to keep this check centralized. */ + if (DECL_P (fndecl_or_type) && !DECL_STATIC_CHAIN (fndecl_or_type)) + return NULL; + if (incoming_p) { #ifdef STATIC_CHAIN_INCOMING_REGNUM --------------2.8.1--