From 9502706b6bfb9c64e6dcdf0fda503997b4a31ab5 Mon Sep 17 00:00:00 2001 From: hubicka Date: Mon, 10 Nov 2014 19:14:17 +0000 Subject: [PATCH] PR bootstrap/63573 * calls.c (initialize_argument_information): When emitting thunk call use original memory placement of the argument. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217307 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/calls.c | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f29986b66825..10bd4806f634 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-11-10 Jan Hubicka + + PR bootstrap/63573 + * calls.c (initialize_argument_information): When emitting thunk call + use original memory placement of the argument. + 2014-11-10 Renlin Li PR middle-end/61529 diff --git a/gcc/calls.c b/gcc/calls.c index 06b8485ff7fa..7f55aafa7346 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -1304,6 +1304,16 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, && TREE_CODE (base) != SSA_NAME && (!DECL_P (base) || MEM_P (DECL_RTL (base))))) { + /* Argument setup code may have copied the value to register. We + revert that optimization now because the tail call code must + use the original location. */ + if (TREE_CODE (args[i].tree_value) == PARM_DECL + && !MEM_P (DECL_RTL (args[i].tree_value)) + && DECL_INCOMING_RTL (args[i].tree_value) + && MEM_P (DECL_INCOMING_RTL (args[i].tree_value))) + set_decl_rtl (args[i].tree_value, + DECL_INCOMING_RTL (args[i].tree_value)); + mark_addressable (args[i].tree_value); /* We can't use sibcalls if a callee-copied argument is -- 2.47.3