[Bug ipa/94693] IPA SRA should elide unused out parameters

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Apr 21 14:47:05 GMT 2020


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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Another testcase would be like

int foo (void **ret)
{
  *ret = NULL;
  return 0;
}

int bar ()
{
  void *dummy;
  return bar (&dummy);
}


int main()
{
  void *dummy;
  if (!foo (&dummy))
    return 0;
  abort ();
}

and ret/dummy can be elided.  I've included the twist that we pass two
different
'dummy' (but I understand IPA SRA works per call and doesn't try "sharing"
the clones?)


More information about the Gcc-bugs mailing list