diff options
author | wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-02-12 13:31:48 +0000 |
---|---|---|
committer | wilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-02-12 13:31:48 +0000 |
commit | 8070ac1a6bb1b36c0df52c63dbe060abf6bc3e82 (patch) | |
tree | 7c82effa40734a355a02edf3747e67c31c5b7128 /gcc/stmt.c | |
parent | 37f7956e16cd10042f4f5656277fb6f24b36a038 (diff) | |
download | gcc-8070ac1a6bb1b36c0df52c63dbe060abf6bc3e82.tar.gz |
Fix linux-x-cygwin build failure with readline.
* stmt.c (expand_return): Return if optimize_tail_recursion succeeded.
(optimize_tail_recursion): Change return type from void to int.
Add return statements.
* tree.h (optimize_tail_recursion): Change prototype to match.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25170 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r-- | gcc/stmt.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c index a565adf6402..0bcc78c3dcb 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -2632,7 +2632,8 @@ expand_return (retval) } /* Attempt to optimize the call if it is tail recursive. */ - optimize_tail_recursion (retval_rhs, last_insn); + if (optimize_tail_recursion (retval_rhs, last_insn)) + return; #ifdef HAVE_return /* This optimization is safe if there are local cleanups @@ -2840,12 +2841,13 @@ drop_through_at_end_p () /* Test CALL_EXPR to determine if it is a potential tail recursion call and emit code to optimize the tail recursion. LAST_INSN indicates where - to place the jump to the tail recursion label. + to place the jump to the tail recursion label. Return TRUE if the + call was optimized into a goto. This is only used by expand_return, but expand_call is expected to use it soon. */ -void +int optimize_tail_recursion (call_expr, last_insn) tree call_expr; rtx last_insn; @@ -2874,7 +2876,10 @@ optimize_tail_recursion (call_expr, last_insn) emit_queue (); expand_goto_internal (NULL_TREE, tail_recursion_label, last_insn); emit_barrier (); + return 1; } + + return 0; } /* Emit code to alter this function's formal parms for a tail-recursive call. |