This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: tail calls in const functions?
- To: Jan Hubicka <hubicka at atrey dot karlin dot mff dot cuni dot cz>
- Subject: Re: tail calls in const functions?
- From: Richard Henderson <rth at cygnus dot com>
- Date: Fri, 24 Mar 2000 02:22:15 -0800
- Cc: egcs at egcs dot cygnus dot com
- References: <20000323152431.C2277@atrey.karlin.mff.cuni.cz>
On Thu, Mar 23, 2000 at 03:24:31PM +0100, Jan Hubicka wrote:
> The tail call optimization makes function to modify the stack, that
> belongs to the caller. Is this valid for const function?
It doesn't belong to the caller. Not any more than
call-clobbered registers do.
> IMO gcc has right to optimize out:
> int test()
> {
> return c(1) + d(1);
> }
> the second store of 1, in case c is const function
I don't agree.
r~