From patchwork Fri Jun 26 17:59:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew MacLeod X-Patchwork-Id: 488952 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 70F87140284 for ; Sat, 27 Jun 2015 03:59:15 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=nXFCfNE5; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=OvZ6JRWK/kmNndb7K 3Yl/KDcu5pEJ4Vk0AtoudWUVTXMnyjUyQthB8GyT6fXNkD3+cmLlzWsiL79xI5Dm 0kQUGDWCGW5DbPevHwuAwBdXrSexZ8jfRs05r8Zk+m1YfGxgwOmRv+yL16LBts6A 6AtVJIWMk2zaDK7Sj6fXEUhU2I= 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=QkTul9WHyIH7pwX5Haw2qu/ Vx1A=; b=nXFCfNE5uP1Cwn/q6BEWOvE2uEr5u/rqkjU7wjAs2BduHIHuXzoKlJ1 c0qknip69qQKwM2c124jcYeN+oDqvkdvbBsC8t+UAHjCKt1amFMTv7dZr+tb+X5A KH2VY5yG46bYWUKoMbkwNY6zqpAf6NGJjrS1EvsRG4Ug1URFicH8= Received: (qmail 75092 invoked by alias); 26 Jun 2015 17:59: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 75078 invoked by uid 89); 26 Jun 2015 17:59:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_50, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 26 Jun 2015 17:59:03 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id A82A131ED2B; Fri, 26 Jun 2015 17:59:02 +0000 (UTC) Received: from [10.10.57.197] (vpn-57-197.rdu2.redhat.com [10.10.57.197]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5QHx1Za013660; Fri, 26 Jun 2015 13:59:01 -0400 Message-ID: <558D92E5.1090907@redhat.com> Date: Fri, 26 Jun 2015 13:59:01 -0400 From: Andrew MacLeod User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Richard Biener , Jeff Law CC: gcc-patches Subject: Re: [patch] Remove fold-const.h as a dependency for gimple.h References: <558C650F.30008@redhat.com> <558C6B41.40701@redhat.com> In-Reply-To: X-IsSubscribed: yes On 06/26/2015 05:40 AM, Richard Biener wrote: > On Thu, Jun 25, 2015 at 10:57 PM, Jeff Law wrote: >> On 06/25/2015 02:31 PM, Andrew MacLeod wrote: >>> I proposed including fold-const.h into gimple.h, but didn't notice that >>> its actually only needed by one inline function. Moving that function to >>> gimple.c means its no longer required. >>> >> OK. > Well, it's also just lazy in using build_fold_addr_expr_loc because it > doesn't want to spell out the all-tree.h > > build1_loc (gimple_location (gs), ADDR_EXPR, build_pointer_type > (decl), decl); > > there is nothing to be simplified (setting a location here is also a waste). > > Richard. > > Easy enough... how about this for trunk? bootstraps on x86_64-unknown-linux-gnu with no new regressions. Andrew 2015-06-26 Andrew MacLeod * gimple.c (gimple_call_set_fndecl): Remove. * gimple.h (gimple_call_set_fndecl): Relocate to gimple.h and call build1_loc directly instead of build_fold_addr_expr_loc. Index: gimple.c =================================================================== *** gimple.c (revision 225011) --- gimple.c (working copy) *************** gimple_build_return (tree retval) *** 199,214 **** return s; } - /* Set FNDECL to be the function called by call statement GS. */ - - void - gimple_call_set_fndecl (gimple gs, tree decl) - { - GIMPLE_CHECK (gs, GIMPLE_CALL); - gcc_gimple_checking_assert (!gimple_call_internal_p (gs)); - gimple_set_op (gs, 1, build_fold_addr_expr_loc (gimple_location (gs), decl)); - } - /* Reset alias information on call S. */ void --- 199,204 ---- Index: gimple.h =================================================================== *** gimple.h (revision 225011) --- gimple.h (working copy) *************** extern gimple currently_expanding_gimple *** 1296,1302 **** #define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO) gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL); greturn *gimple_build_return (tree); - void gimple_call_set_fndecl (gimple, tree); void gimple_call_reset_alias_info (gcall *); gcall *gimple_build_call_vec (tree, vec ); gcall *gimple_build_call (tree, unsigned, ...); --- 1296,1301 ---- *************** gimple_call_set_fn (gcall *gs, tree fn) *** 2760,2765 **** --- 2759,2777 ---- } + /* Set FNDECL to be the function called by call statement GS. */ + + static inline void + gimple_call_set_fndecl (gimple gs, tree decl) + { + GIMPLE_CHECK (gs, GIMPLE_CALL); + gcc_gimple_checking_assert (!gimple_call_internal_p (gs)); + gimple_set_op (gs, 1, build1_loc (gimple_location (gs), ADDR_EXPR, + build_pointer_type (TREE_TYPE (decl)), + decl)); + } + + /* Set internal function FN to be the function called by call statement CALL_STMT. */ static inline void