summaryrefslogtreecommitdiff
path: root/gcc/tree-tailcall.c
diff options
context:
space:
mode:
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-26 15:08:50 +0000
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-26 15:08:50 +0000
commit6070c03585d1fbef96c79f02ee97abdfc64bef1f (patch)
tree001ffb21efda9c3fb69f2a80771b3f74a68f663a /gcc/tree-tailcall.c
parent58a1adeaea65751aa32d498fcaa0e7cbcacf535e (diff)
downloadgcc-6070c03585d1fbef96c79f02ee97abdfc64bef1f.tar.gz
PR middle-end/19616
* tree.h (CALL_EXPR_TAILCALL): Add comment. * calls.c (check_sibcall_argument_overlap_1): Revert the change to this function from 2004-07-10. * tree-tailcall.c (suitable_for_tail_opt_p): Do not consider the the current function for tail call optimizations if the address of one of it its arguments is taken. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94265 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-tailcall.c')
-rw-r--r--gcc/tree-tailcall.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index 5c5e09cce05..a76314bc835 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -159,6 +159,8 @@ suitable_for_tail_opt_p (void)
static bool
suitable_for_tail_call_opt_p (void)
{
+ tree param;
+
/* alloca (until we have stack slot life analysis) inhibits
sibling call optimizations, but not tail recursion. */
if (current_function_calls_alloca)
@@ -176,6 +178,14 @@ suitable_for_tail_call_opt_p (void)
if (current_function_calls_setjmp)
return false;
+ /* ??? It is OK if the argument of a function is taken in some cases,
+ but not in all cases. See PR15387 and PR19616. Revisit for 4.1. */
+ for (param = DECL_ARGUMENTS (current_function_decl);
+ param;
+ param = TREE_CHAIN (param))
+ if (TREE_ADDRESSABLE (param))
+ return false;
+
return true;
}