This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: stmt.c (expand_return): Return if optimize_tail_recursion succeeded.
- To: Jim Wilson <wilson at cygnus dot com>
- Subject: Re: stmt.c (expand_return): Return if optimize_tail_recursion succeeded.
- From: Jeffrey A Law <law at hurl dot cygnus dot com>
- Date: Sat, 13 Feb 1999 00:35:07 -0700
- cc: egcs-patches at egcs dot cygnus dot com
- Reply-To: law at cygnus dot com
In message <199902122137.NAA07704@ada.cygnus.com.cygnus.com>you write:
> I have checked in the following patch.
>
> This fixes a problem where the cygwin compiler was calling abort while
> compiling readline. This was accidentally introduced Jan 8 when Jeff Law
> created the new function optimize_tail_recursion. A return statement in
> expand_return was lost when that happened.
>
> Simplified testcase (maybe this should be put in the testsuite?):
>
> sub (int i)
> {
> if (i == 0)
> return 0;
> else
> return sub (({int j; j = i - 1; j;}));
> }
>
> Patch:
>
> 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.
Thanks. I feel silly and stoooopid :(
jeff