diff mbox

[v2] Get rid of stack trampolines for nested functions (1/4)

Message ID mvm7f38o61e.fsf@suse.de
State New
Headers show

Commit Message

Andreas Schwab March 29, 2017, 8:12 a.m. UTC
On Mär 28 2017, Eric Botcazou <ebotcazou@adacore.com> wrote:

>> That needs to use ptr_mode, not Pmode.
>
> I don't think so, the whole computation is in Pmode.  Could you try something 
> similar to what is done in the 'else' arm of the big surrounding conditional?

Thanks, this gets me further, the ada library now compiles with
-mabi=ilp32.  But I still see some ICEs while running the testsuite,
which I haven't investigated yet.  And the original comment before this
hunk doesn't make sense at this point.

Andreas.

Comments

Eric Botcazou March 29, 2017, 1:59 p.m. UTC | #1
> Thanks, this gets me further, the ada library now compiles with
> -mabi=ilp32.

Great, I think that you can apply it as obvious then, it's code which is only 
exercised in Ada and on ILP32 64-bit platforms so the risk is very low...

> But I still see some ICEs while running the testsuite,
> which I haven't investigated yet.  And the original comment before this
> hunk doesn't make sense at this point.

The hunk in the 'else' arm of the big surrounding conditional?
Andreas Schwab March 29, 2017, 2:05 p.m. UTC | #2
On Mär 29 2017, Eric Botcazou <ebotcazou@adacore.com> wrote:

>> But I still see some ICEs while running the testsuite,
>> which I haven't investigated yet.  And the original comment before this
>> hunk doesn't make sense at this point.
>
> The hunk in the 'else' arm of the big surrounding conditional?

Yes.  It talks about SYMBOL_REF which it clearly isn't at this point.

Andreas.
diff mbox

Patch

diff --git a/gcc/calls.c b/gcc/calls.c
index 61caf4ca75..c92e35ea5a 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -206,6 +206,9 @@  prepare_call_address (tree fndecl_or_type, rtx funexp, rtx static_chain_value,
 	  DECL_STATIC_CHAIN (fndecl_or_type) = 1;
 	  rtx chain = targetm.calls.static_chain (fndecl_or_type, false);
 
+	  if (GET_MODE (funexp) != Pmode)
+	    funexp = convert_memory_address (Pmode, funexp);
+
 	  /* Avoid long live ranges around function calls.  */
 	  funexp = copy_to_mode_reg (Pmode, funexp);