summaryrefslogtreecommitdiff
path: root/gcc/tree-tailcall.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-09 23:48:56 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-09 23:48:56 +0000
commit6108f5ddd046bf958c06ed537952594219368999 (patch)
tree93531239041220e62b624b138bb2d8e5cdc5e162 /gcc/tree-tailcall.c
parent786d45db7ebff269c37501cc38e1f3c7960c4815 (diff)
downloadgcc-6108f5ddd046bf958c06ed537952594219368999.tar.gz
PR opt/15108
* tree-tailcall.c (find_tail_calls): Don't check early for tail_recursion failure. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82866 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-tailcall.c')
-rw-r--r--gcc/tree-tailcall.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index 5027c2b6f41..47d707682b3 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -460,11 +460,6 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
if (TREE_CODE (stmt) != MODIFY_EXPR)
return;
- /* Unless this is a tail recursive call, we cannot do anything with
- the statement anyway. */
- if (!tail_recursion)
- return;
-
if (!process_assignment (stmt, stmt, bsi, &m, &a, &ass_var))
return;
}
@@ -491,6 +486,11 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
&& (ret_var != ass_var))
return;
+ /* If this is not a tail recursive call, we cannot handle addends or
+ multiplicands. */
+ if (!tail_recursion && (m || a))
+ return;
+
nw = xmalloc (sizeof (struct tailcall));
nw->call_block = bb;