fix 15108
Richard Henderson
rth@redhat.com
Thu Jun 10 01:07:00 GMT 2004
We handle casts inside the process_assignment call there.
r~
PR opt/15108
* tree-tailcall.c (find_tail_calls): Don't check early for
tail_recursion failure.
Index: tree-tailcall.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-tailcall.c,v
retrieving revision 2.6
diff -c -p -d -r2.6 tree-tailcall.c
*** tree-tailcall.c 9 Jun 2004 15:07:03 -0000 2.6
--- tree-tailcall.c 9 Jun 2004 23:44:05 -0000
*************** find_tail_calls (basic_block bb, struct
*** 460,470 ****
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;
}
--- 460,465 ----
*************** find_tail_calls (basic_block bb, struct
*** 491,496 ****
--- 486,496 ----
&& (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;
More information about the Gcc-patches
mailing list