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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think if IPA modref declares the argument dead at the call site then IPA
CP/SRA cannot declare it known constant.

Now, I wonder why IPA CP/SRA does not replace the known constant parameter
with an automatic var like

point.constprop.isra (double ISRA.1740, int & restrict ipoint, double &
restrict x, double & restrict y, double & restrict z, int & restrict istat)
{
...
  const int istat.local = 0;
  istat = &istat.local;

?  So if not all uses of 'istat' get resolved we avoid generating wrong
code.  The expense is a constant pool entry (if not all uses are removed),
but I think that's OK.  It would also work for aggregates.  It would also
relieve IPA-CP modification phase from doing anything but trival value
replacement (in case the arg isn't apointer).

Reply via email to