https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67170

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
I wonder why IPA SRA doesn't turn the scalar parameter from by-reference to
by-value passing btw.  I do see that IPA SRA doesn't handle recursion though,
thus

static int __attribute__((noinline)) foo (int *p)
{
  if (*p)
    return foo (p);
  return *p;
}

int main()
{
  int i = 0;
  return foo (&i);
}

is not transformed.  But in the testcase there isn't a recursive call using
the incoming parameter.

As for the idea to use the alias machinery I'm now leaning towards either
having PTA compute a "points-to-readonly" or SCCVN/LIM pre-compute the
parm-decl
property and have its own disambiguator handle the disambiguation.

Reply via email to