summaryrefslogtreecommitdiff
path: root/gcc/tree-tailcall.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-02 18:10:53 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-02 18:10:53 +0000
commit40a612434a7804d56c8c5e577e9c93fbed9778d8 (patch)
treed3e8d7fdfa7e09e4efa1a960a61d8463e612195b /gcc/tree-tailcall.c
parent14d651f98b3910af1c064a96277dbd5491e18bf5 (diff)
downloadgcc-40a612434a7804d56c8c5e577e9c93fbed9778d8.tar.gz
2010-05-02 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43879 * tree-tailcall.c (find_tail_calls): Clobbers also prevent tail calls. * gcc.dg/torture/pr43879-3.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158977 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-tailcall.c')
-rw-r--r--gcc/tree-tailcall.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index a9f01919b4d..ec6d2fdff68 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -460,7 +460,8 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
{
if (TREE_CODE (var) != PARM_DECL
&& auto_var_in_fn_p (var, cfun->decl)
- && ref_maybe_used_by_stmt_p (call, var))
+ && (ref_maybe_used_by_stmt_p (call, var)
+ || call_may_clobber_ref_p (call, var)))
return;
}