From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73429 invoked by alias); 23 Mar 2017 16:47:42 -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 73379 invoked by uid 89); 23 Mar 2017 16:47:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=HTo:U*ebotcazou, sk:restore, Hx-languages-length:1949, gpg X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 23 Mar 2017 16:47:40 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4BBD4AB4B; Thu, 23 Mar 2017 16:47:39 +0000 (UTC) From: Andreas Schwab To: Eric Botcazou Cc: gcc-patches@gcc.gnu.org Subject: Re: [patch v2] Get rid of stack trampolines for nested functions (1/4) References: <1518726.5fkcUnkpqM@arcturus.home> <8467344.X3JSntxAug@arcturus.home> X-Yow: It was a JOKE!! Get it?? I was receiving messages from DAVID LETTERMAN!! YOW!! Date: Thu, 23 Mar 2017 16:48:00 -0000 In-Reply-To: <8467344.X3JSntxAug@arcturus.home> (Eric Botcazou's message of "Sun, 04 Sep 2016 22:10:41 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2017-03/txt/msg01236.txt.bz2 On Sep 04 2016, Eric Botcazou wrote: > Index: calls.c > =================================================================== > --- calls.c (revision 239944) > +++ calls.c (working copy) > @@ -183,17 +183,76 @@ static void restore_fixed_argument_area (rtx, rtx, > > rtx > prepare_call_address (tree fndecl_or_type, rtx funexp, rtx static_chain_value, > - rtx *call_fusage, int reg_parm_seen, int sibcallp) > + rtx *call_fusage, int reg_parm_seen, int flags) > { > /* Make a valid memory address and copy constants through pseudo-regs, > but not for a constant address if -fno-function-cse. */ > if (GET_CODE (funexp) != SYMBOL_REF) > - /* If we are using registers for parameters, force the > - function address into a register now. */ > - funexp = ((reg_parm_seen > - && targetm.small_register_classes_for_mode_p (FUNCTION_MODE)) > - ? force_not_mem (memory_address (FUNCTION_MODE, funexp)) > - : memory_address (FUNCTION_MODE, funexp)); > + { > + /* If it's an indirect call by descriptor, generate code to perform > + runtime identification of the pointer and load the descriptor. */ > + if ((flags & ECF_BY_DESCRIPTOR) && !flag_trampolines) > + { > + const int bit_val = targetm.calls.custom_function_descriptors; > + rtx call_lab = gen_label_rtx (); > + > + gcc_assert (fndecl_or_type && TYPE_P (fndecl_or_type)); > + fndecl_or_type > + = build_decl (UNKNOWN_LOCATION, FUNCTION_DECL, NULL_TREE, > + fndecl_or_type); > + DECL_STATIC_CHAIN (fndecl_or_type) = 1; > + rtx chain = targetm.calls.static_chain (fndecl_or_type, false); > + > + /* Avoid long live ranges around function calls. */ > + funexp = copy_to_mode_reg (Pmode, funexp); That needs to use ptr_mode, not Pmode. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."