http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59813

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
If you only care about tail recursion and not tail call optimization, perhaps,
but either solution would be very dumb.  We now have var ={v} {CLOBBER}; stmts,
even if those vars escape and are address taken, if there is a clobber stmt for
those vars on every path from the escape point to the tail call candidate, we
could perform tail recursion or tail call optimization, what we are really
after is that the address of no automatic variable from the current function
can escape to the tail recursion/call candidate.
As in:
void bar (char *);
void
foo (char *p)
{
  char c;
  bar (&c);
  bar (NULL); // We can't tail call optimize this
}

void
baz (char *p)
{
  {
    char c;
    bar (&c);
  }
  bar (NULL); // We could tail call optimize this
}

Reply via email to