aboutsummaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2000-05-24 21:43:42 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2000-05-24 21:43:42 +0000
commitf5e846c84cf16462f139fbe475ef40c477118111 (patch)
treea2e82baf04352a994fb25663c70965aa05e4b6ac /gcc/calls.c
parent0d0cd4416983022d5bd65c29b4368069f55684d6 (diff)
downloadgcc-f5e846c84cf16462f139fbe475ef40c477118111.zip
gcc-f5e846c84cf16462f139fbe475ef40c477118111.tar.gz
gcc-f5e846c84cf16462f139fbe475ef40c477118111.tar.bz2
calls.c (expand_call): Handle cleanups in tail-recursion arguments analagously to cleanups in sibling...
* calls.c (expand_call): Handle cleanups in tail-recursion arguments analagously to cleanups in sibling calls. From-SVN: r34143
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 7cf8971..1c2c2ea 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -2400,7 +2400,7 @@ expand_call (exp, target, ignore)
break;
case 1: /* Mildly unsafe. */
- args[i].tree_value = unsave_expr (args[i].tree_value);
+ args[i].tree_value = unsave_expr (args[i].tree_value);
break;
case 2: /* Wildly unsafe. */
@@ -2444,9 +2444,20 @@ expand_call (exp, target, ignore)
made until after RTL generation for the entire function is
complete. */
start_sequence ();
-
+ /* If expanding any of the arguments creates cleanups, we can't
+ do a tailcall. So, we'll need to pop the pending cleanups
+ list. If, however, all goes well, and there are no cleanups
+ then the call to expand_start_target_temps will have no
+ effect. */
+ expand_start_target_temps ();
if (optimize_tail_recursion (actparms, get_last_insn ()))
- tail_recursion_insns = get_insns ();
+ {
+ if (any_pending_cleanups (1))
+ try_tail_call = try_tail_recursion = 0;
+ else
+ tail_recursion_insns = get_insns ();
+ }
+ expand_end_target_temps ();
end_sequence ();
/* Restore the original pending stack adjustment for the sibling and