From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47628 invoked by alias); 12 Sep 2016 19:41:33 -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 47614 invoked by uid 89); 12 Sep 2016 19:41:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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 ESMTP; Mon, 12 Sep 2016 19:41:21 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AD38FC062C93; Mon, 12 Sep 2016 19:41:20 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-111.phx2.redhat.com [10.3.116.111]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8CJfKpq015063; Mon, 12 Sep 2016 15:41:20 -0400 Subject: Re: [patch v2] Get rid of stack trampolines for nested functions (1/4) To: Eric Botcazou , gcc-patches@gcc.gnu.org References: <1518726.5fkcUnkpqM@arcturus.home> <8467344.X3JSntxAug@arcturus.home> From: Jeff Law Message-ID: Date: Mon, 12 Sep 2016 19:45:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <8467344.X3JSntxAug@arcturus.home> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg00661.txt.bz2 On 09/04/2016 02:10 PM, Eric Botcazou wrote: > This is the common infrastructure part. As explained in the initial message, > nothing is activated unless both the language and the target opt in. > > > 2016-07-04 Eric Botcazou > > PR ada/37139 > PR ada/67205 > * common.opt (-ftrampolines): New option. > * doc/invoke.texi (Code Gen Options): Document it. > * doc/tm.texi.in (Trampolines): AddTARGET_CUSTOM_FUNCTION_DESCRIPTORS > * doc/tm.texi: Regenerate. > * builtins.def: Add init_descriptor and adjust_descriptor. > * builtins.c (expand_builtin_init_trampoline): Do not issue a warning > on platforms with descriptors. > (expand_builtin_init_descriptor): New function. > (expand_builtin_adjust_descriptor): Likewise. > (expand_builtin) : New case. > : Likewise. > * calls.c (prepare_call_address): Remove SIBCALLP parameter and add > FLAGS parameter. Deal with indirect calls by descriptor and adjust. > Set STATIC_CHAIN_REG_P on the static chain register, if any. > (call_expr_flags): Set ECF_BY_DESCRIPTOR for calls by descriptor. > (expand_call): Likewise. Move around call to prepare_call_address > and pass all flags to it. > * cfgexpand.c (expand_call_stmt): Reinstate CALL_EXPR_BY_DESCRIPTOR. > * gimple.h (enum gf_mask): New GF_CALL_BY_DESCRIPTOR value. > (gimple_call_set_by_descriptor): New setter. > (gimple_call_by_descriptor_p): New getter. > * gimple.c (gimple_build_call_from_tree): SetCALL_EXPR_BY_DESCRIPTOR. > (gimple_call_flags): Deal with GF_CALL_BY_DESCRIPTOR. > * langhooks.h (struct lang_hooks): Add custom_function_descriptors. > * langhooks-def.h (LANG_HOOKS_CUSTOM_FUNCTION_DESCRIPTORS): Define. > (LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_CUSTOM_FUNCTION_DESCRIPTORS. > * rtl.h (STATIC_CHAIN_REG_P): New macro. > * rtlanal.c (find_first_parameter_load): Skip static chain registers. > * target.def (custom_function_descriptors): New POD hook. > * tree.h (FUNC_ADDR_BY_DESCRIPTOR): New flag on ADDR_EXPR. > (CALL_EXPR_BY_DESCRIPTOR): New flag on CALL_EXPR. > * tree-core.h (ECF_BY_DESCRIPTOR): New mask. > Document FUNC_ADDR_BY_DESCRIPTOR and CALL_EXPR_BY_DESCRIPTOR. > * tree.c (make_node_stat) : Use FUNCTION_ALIGNMENT. > (build_common_builtin_nodes): Initialize init_descriptor and > adjust_descriptor. > * tree-nested.c: Include target.h. > (struct nesting_info): Add 'any_descr_created' field. > (get_descriptor_type): New function. > (lookup_element_for_decl): New function extracted from... > (create_field_for_decl): Likewise. > (lookup_tramp_for_decl): ...here. Adjust. > (lookup_descr_for_decl): New function. > (convert_tramp_reference_op): Deal with descriptors. > (build_init_call_stmt): New function extracted from... > (finalize_nesting_tree_1): ...here. Adjust and deal withdescriptors. > * defaults.h (FUNCTION_ALIGNMENT): Define. > (TRAMPOLINE_ALIGNMENT): Set to above instead of FUNCTION_BOUNDARY. > ANd just to be clear, I'm assuming you'll self-approve the Ada bits :-) jeff