re PR bootstrap/63573 (libgo: ICE building libgo on powerpc-linux-gnu)
authorJan Hubicka <hubicka@ucw.cz>
Mon, 10 Nov 2014 19:14:17 +0000 (20:14 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Mon, 10 Nov 2014 19:14:17 +0000 (19:14 +0000)
PR bootstrap/63573
* calls.c (initialize_argument_information): When emitting thunk call
use original memory placement of the argument.

From-SVN: r217307

gcc/ChangeLog
gcc/calls.c

index f29986b66825e7310f9644a935e579296ca8f23d..10bd4806f6345a00b58faadbbdeb1b03d1bebed8 100644 (file)
@@ -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
index 06b8485ff7fa82708a8f290b6c90b76cf0321731..7f55aafa7346e841cd9130a9e8d4667a25b99837 100644 (file)
@@ -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