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

            Bug ID: 116823
           Summary: phiprop should ignore clobbers
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: pinskia at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
```
const int &c(const int &d, const int &e) {
  if (d < e)
    return e;
  return d;
}

int g(int i, struct f *ff)
{
  const int &a = c(i, 10);
  return a;
}
```

Even though this is undefined code because the lifetime of the temp for 10 is
not extended, we could have phiprop ignore the clobber and optimize like it was
extended.

Reply via email to