public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* tail calls in const functions?
@ 2000-03-23  6:24 Jan Hubicka
  2000-03-23  6:29 ` Jakub Jelinek
  2000-03-24  2:22 ` Richard Henderson
  0 siblings, 2 replies; 7+ messages in thread
From: Jan Hubicka @ 2000-03-23  6:24 UTC (permalink / raw)
  To: egcs

Hi
The tail call optimization makes function to modify the stack, that
belongs to the caller.  Is this valid for const function?
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 (it don't do that currently).
When tail call optimization is done for c, the stack is clobbered.

So perhaps it will be neccesary to disable tail call for const functions.

Honza

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2000-03-24  2:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-23  6:24 tail calls in const functions? Jan Hubicka
2000-03-23  6:29 ` Jakub Jelinek
2000-03-23  6:43   ` Jan Hubicka
2000-03-23  9:09     ` Jeffrey A Law
2000-03-23 14:20       ` Jan Hubicka
2000-03-23 14:47         ` Jeffrey A Law
2000-03-24  2:22 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).