This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch v2] Get rid of stack trampolines for nested functions (1/4)
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Ian Lance Taylor <iant at golang dot org>
- Cc: gcc-patches at gcc dot gnu dot org, "Lynn A. Boger" <laboger at linux dot vnet dot ibm dot com>
- Date: Tue, 06 Dec 2016 18:52:46 +0100
- Subject: Re: [patch v2] Get rid of stack trampolines for nested functions (1/4)
- Authentication-results: sourceware.org; auth=none
- References: <1518726.5fkcUnkpqM@arcturus.home> <CAKOQZ8zuKwVpPTUCHqoCvv5DrKfvV_K+Xa+=bXMPXN9S05mxZA@mail.gmail.com> <3049494.GQlGFrCAi9@polaris>
> There are a couple of changes to the RTL expander for calls; they are
> supposed to be transparent but they might have tripped on a latent issue.
Tentative fix attached, I need to test it extensively in Ada though.
Btw, Ian, if the heap trampoline support is no longer used by the Go compiler,
you might want to remove it from the middle-end.
--
Eric Botcazou
Index: calls.c
===================================================================
--- calls.c (revision 243245)
+++ calls.c (working copy)
@@ -3427,13 +3427,6 @@ expand_call (tree exp, rtx target, int i
if (STRICT_ALIGNMENT)
store_unaligned_arguments_into_pseudos (args, num_actuals);
- /* Prepare the address of the call. This must be done before any
- register parameters is loaded for find_first_parameter_load to
- work properly in the presence of descriptors. */
- funexp = prepare_call_address (fndecl ? fndecl : fntype, funexp,
- static_chain_value, &call_fusage,
- reg_parm_seen, flags);
-
/* Now store any partially-in-registers parm.
This is the last place a block-move can happen. */
if (reg_parm_seen)
@@ -3544,6 +3537,9 @@ expand_call (tree exp, rtx target, int i
}
after_args = get_last_insn ();
+ funexp = prepare_call_address (fndecl ? fndecl : fntype, funexp,
+ static_chain_value, &call_fusage,
+ reg_parm_seen, flags);
load_register_parameters (args, num_actuals, &call_fusage, flags,
pass == 0, &sibcall_failure);