diff options
author | Richard Henderson <rth@cygnus.com> | 2000-03-26 16:50:27 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2000-03-26 16:50:27 -0800 |
commit | b06775f990ad9fdc378388df18bbebf7d03ef9e3 (patch) | |
tree | ea8ea170426cc8cb9e99e73acabed34e6c0a6bc2 /gcc/calls.c | |
parent | a843e0ced84306002584b6c824996632690149d7 (diff) | |
download | gcc-b06775f990ad9fdc378388df18bbebf7d03ef9e3.zip gcc-b06775f990ad9fdc378388df18bbebf7d03ef9e3.tar.gz gcc-b06775f990ad9fdc378388df18bbebf7d03ef9e3.tar.bz2 |
calls.c (expand_call): Pass parms not original exp to optimize_tail_recursion.
* calls.c (expand_call): Pass parms not original exp to
optimize_tail_recursion. Mind return value instead of looking
for a barrier.
* stmt.c (optimize_tail_recursion): Take parameter list, not entire
call_expr. Move checks for call_expr and current_function_decl ...
(expand_return): ... here.
From-SVN: r32758
Diffstat (limited to 'gcc/calls.c')
-rw-r--r-- | gcc/calls.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/gcc/calls.c b/gcc/calls.c index ed4b31b..07898c3 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -2099,28 +2099,20 @@ expand_call (exp, target, ignore) recursion call can be ignored if we indeed use the tail recursion call expansion. */ int save_pending_stack_adjust = pending_stack_adjust; - rtx last; /* Use a new sequence to hold any RTL we generate. We do not even know if we will use this RTL yet. The final decision can not be made until after RTL generation for the entire function is complete. */ - push_to_sequence (0); + start_sequence (); /* Emit the pending stack adjustments before we expand any arguments. */ do_pending_stack_adjust (); - optimize_tail_recursion (exp, get_last_insn ()); - - last = get_last_insn (); - tail_recursion_insns = get_insns (); + if (optimize_tail_recursion (actparms, get_last_insn ())) + tail_recursion_insns = get_insns (); end_sequence (); - /* If the last insn on the tail recursion sequence is not a - BARRIER, then tail recursion optimization failed. */ - if (last == NULL_RTX || GET_CODE (last) != BARRIER) - tail_recursion_insns = NULL_RTX; - /* Restore the original pending stack adjustment for the sibling and normal call cases below. */ pending_stack_adjust = save_pending_stack_adjust; |