This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: gcc 2.92.2: bad code generation from tail-call optimization (x86)
- To: goodwin at tensilica dot com
- Subject: Re: gcc 2.92.2: bad code generation from tail-call optimization (x86)
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Tue, 28 Mar 2000 11:30:34 -0700
- cc: gcc-bugs at gcc dot gnu dot org, maydan at tensilica dot com
- Reply-To: law at cygnus dot com
In message <14443.40523.991206.668791@spleen.hq.tensilica.com>you write:
>
> The included function, when compiled with gcc 2.95.2 generates bad code for
> x86 because of an incorrectly applied tail-call optimization. The function
> takes the address of an automatic, and thus should not be a candidate for
> tail-calls. The source and assembly code are commented to show the location
> of the incorrect tail-call.
>
> We took a quick look into the possible cause, and it appears that the
> function that implements the optimization in stmt.c:optimize_tail_resursion
> is using 'frame_offset' before it is calculated.
>
> BTW, egcs-2.91.66 fails in the same way.
I believe this has been fixed in the development sources.
jeff