calls.c (initialize_argument_information): Forbid sibcalls if a callee-copied argumen...
authorRichard Sandiford <rsandifo@redhat.com>
Sat, 22 May 2004 10:43:56 +0000 (10:43 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sat, 22 May 2004 10:43:56 +0000 (10:43 +0000)
* calls.c (initialize_argument_information): Forbid sibcalls if a
callee-copied argument is stored in the current function's frame.

From-SVN: r82129

gcc/ChangeLog
gcc/calls.c

index 3c455e6c3b46a8a08d85d9a503e3e4d6bcd109be..a01a10851d08167959c115cb61909d50fa413be2 100644 (file)
@@ -1,3 +1,8 @@
+2004-05-22  Richard Sandiford  <rsandifo@redhat.com>
+
+       * calls.c (initialize_argument_information): Forbid sibcalls if a
+       callee-copied argument is stored in the current function's frame.
+
 2004-05-22  Eric Christopher  <echristo@redhat.com>
 
        * fix-header.c (read_scan_file): Update for add_path change.
index 419f45881a18c97ba057d99bf70fabe30aa5160f..48d62f83e5235da294c17b09a0be3374e545f298 100644 (file)
@@ -1129,6 +1129,13 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
                  && ! REG_P (DECL_RTL (TREE_OPERAND (args[i].tree_value, 1))))
                args[i].tree_value = TREE_OPERAND (args[i].tree_value, 1);
 
+             /* We can't use sibcalls if a callee-copied argument is stored
+                in the current function's frame.  */
+             if (!call_from_thunk_p
+                 && (!DECL_P (args[i].tree_value)
+                     || !TREE_STATIC (args[i].tree_value)))
+               *may_tailcall = false;
+
              args[i].tree_value = build1 (ADDR_EXPR,
                                           build_pointer_type (type),
                                           args[i].tree_value);