Fix linux-x-cygwin build failure with readline.
authorJim Wilson <wilson@cygnus.com>
Fri, 12 Feb 1999 13:31:48 +0000 (13:31 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Fri, 12 Feb 1999 13:31:48 +0000 (05:31 -0800)
* 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.

From-SVN: r25170

gcc/ChangeLog
gcc/stmt.c
gcc/tree.h

index b88e8f84b9c570873e4476f66b4910c7ef44296e..507c2e56a8ff74d301ecd338d0674af6c062f2a3 100644 (file)
@@ -1,3 +1,10 @@
+Fri Feb 12 13:06:28 1999  Jim Wilson  <wilson@cygnus.com>
+
+       * 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.
+
 Fri Feb 12 21:09:51 1999  J"orn Rennecke <amylaar@cygnus.co.uk>
 
        * reload.c (find_reloads_subreg_address): New function, broken out of
index a565adf640209bc718080cf54c24412ddb285eb3..0bcc78c3dcb253c38f05cbe77f50d944e21f0387 100644 (file)
@@ -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 ()
 \f
 /* 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.
index 389d23d3ed37a9d3dfc494ae1d2ef08591c17dd2..2f1d8e6130f9eea43b4c5f701a87541f194d1d0d 100644 (file)
@@ -1933,7 +1933,7 @@ extern int expand_exit_something          PROTO((void));
 
 extern void expand_null_return                 PROTO((void));
 extern void expand_return                      PROTO((tree));
-extern void optimize_tail_recursion            PROTO((tree, struct rtx_def *));
+extern int optimize_tail_recursion             PROTO((tree, struct rtx_def *));
 extern void expand_start_bindings              PROTO((int));
 extern void expand_end_bindings                        PROTO((tree, int, int));
 extern void start_cleanup_deferral             PROTO((void));