diff options
author | Steven Bosscher <steven@gcc.gnu.org> | 2005-01-26 15:08:50 +0000 |
---|---|---|
committer | Steven Bosscher <steven@gcc.gnu.org> | 2005-01-26 15:08:50 +0000 |
commit | ead553a1d9f9206c1f5a3b1a6799ea877fc9a845 (patch) | |
tree | 001ffb21efda9c3fb69f2a80771b3f74a68f663a /gcc/tree-tailcall.c | |
parent | 7533544070c29d561a1b570c08f126123264e150 (diff) | |
download | gcc-ead553a1d9f9206c1f5a3b1a6799ea877fc9a845.zip gcc-ead553a1d9f9206c1f5a3b1a6799ea877fc9a845.tar.gz gcc-ead553a1d9f9206c1f5a3b1a6799ea877fc9a845.tar.bz2 |
re PR middle-end/19616 (missed tail call)
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.
From-SVN: r94265
Diffstat (limited to 'gcc/tree-tailcall.c')
-rw-r--r-- | gcc/tree-tailcall.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c index 5c5e09c..a76314b 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; } |