From: Andreas Schwab <schwab@suse.de>
To: Eric Botcazou <ebotcazou@adacore.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [patch v2] Get rid of stack trampolines for nested functions (1/4)
Date: Thu, 23 Mar 2017 16:48:00 -0000 [thread overview]
Message-ID: <mvm37e4rlcm.fsf@suse.de> (raw)
In-Reply-To: <8467344.X3JSntxAug@arcturus.home> (Eric Botcazou's message of "Sun, 04 Sep 2016 22:10:41 +0200")
On Sep 04 2016, Eric Botcazou <ebotcazou@adacore.com> 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."
next prev parent reply other threads:[~2017-03-23 16:47 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-04 20:10 [patch v2] Get rid of stack trampolines for nested functions (0/4) Eric Botcazou
2016-09-04 20:12 ` [patch v2] Get rid of stack trampolines for nested functions (1/4) Eric Botcazou
2016-09-12 19:41 ` Jeff Law
2016-09-12 19:45 ` Jeff Law
2016-12-05 20:52 ` Ian Lance Taylor
2016-12-05 21:29 ` Lynn A. Boger
2016-12-05 22:41 ` Ian Lance Taylor
2016-12-05 22:12 ` Eric Botcazou
2016-12-06 17:52 ` Eric Botcazou
2016-12-06 20:18 ` Ian Lance Taylor
2016-12-06 21:59 ` Lynn A. Boger
2016-12-06 22:26 ` Eric Botcazou
2016-12-07 13:38 ` Lynn A. Boger
2016-12-07 13:56 ` Eric Botcazou
2016-12-07 7:23 ` Eric Botcazou
2017-03-23 16:48 ` Andreas Schwab [this message]
2017-03-28 17:01 ` Eric Botcazou
2017-03-29 10:05 ` Andreas Schwab
2017-03-29 14:05 ` Eric Botcazou
2017-03-29 14:15 ` Andreas Schwab
2016-09-04 20:14 ` [patch v2] Get rid of stack trampolines for nested functions (2/4) Eric Botcazou
2016-09-04 20:15 ` [patch v2] Get rid of stack trampolines for nested functions (3/4) Eric Botcazou
2016-09-05 10:52 ` Segher Boessenkool
2016-09-12 19:56 ` Jeff Law
2016-09-04 21:31 ` [patch v2] Get rid of stack trampolines for nested functions (4/4) Eric Botcazou
2016-10-16 20:29 ` [patch v2] Get rid of stack trampolines for nested functions (0/4) Eric Botcazou
2016-10-17 10:40 ` Andreas Schwab
2016-10-17 11:14 ` Eric Botcazou
2016-10-17 22:35 ` Eric Botcazou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=mvm37e4rlcm.fsf@suse.de \
--to=schwab@suse.de \
--cc=ebotcazou@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).