From c71e72dd3000f863578ab64c8ba35d961f0cef5b Mon Sep 17 00:00:00 2001 From: rsandifo Date: Sat, 22 May 2004 10:43:56 +0000 Subject: [PATCH] * calls.c (initialize_argument_information): Forbid sibcalls if a callee-copied argument is stored in the current function's frame. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82129 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/calls.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3c455e6..a01a108 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-05-22 Richard Sandiford + + * 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 * fix-header.c (read_scan_file): Update for add_path change. diff --git a/gcc/calls.c b/gcc/calls.c index 419f458..48d62f8 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -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); -- 2.7.4