aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2014-11-10 20:14:17 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2014-11-10 19:14:17 +0000
commitfe8dd12e2057860085caad10d0f4d2c681ff8bf9 (patch)
treeea3e010ea64a6fc13c330cfb2ace81f92aea443d
parentbe8118c57b2b52b71f27c74c9db2495cf9466c41 (diff)
downloadgcc-fe8dd12e2057860085caad10d0f4d2c681ff8bf9.zip
gcc-fe8dd12e2057860085caad10d0f4d2c681ff8bf9.tar.gz
gcc-fe8dd12e2057860085caad10d0f4d2c681ff8bf9.tar.bz2
re PR bootstrap/63573 (libgo: ICE building libgo on powerpc-linux-gnu)
PR bootstrap/63573 * calls.c (initialize_argument_information): When emitting thunk call use original memory placement of the argument. From-SVN: r217307
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/calls.c10
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f29986b..10bd480 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2014-11-10 Jan Hubicka <hubicka@ucw.cz>
+
+ PR bootstrap/63573
+ * calls.c (initialize_argument_information): When emitting thunk call
+ use original memory placement of the argument.
+
2014-11-10 Renlin Li <renlin.li@arm.com>
PR middle-end/61529
diff --git a/gcc/calls.c b/gcc/calls.c
index 06b8485..7f55aaf 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