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

            Bug ID: 117096
           Summary: Clobbers sometimes gets in the way of phiopt
           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:
```
struct s1{
  unsigned b = 0;
};
int f(short a, int c)
{
  unsigned b = 0;
  if (a < 0)
  {
        s1();
        b = a;
  }
  return b;
}


int f1(short a, int c)
{
  unsigned b = 0;
  if (a < 0)
  {
        s1 t;
        b = a;
  }
  return b;
}
```

These 2 should be transformed into:
  _7 = MIN_EXPR <a_3(D), 0>;
  b_1 = (unsigned intD.15) _7;
  _6 = (intD.10) b_1;

In phiopt1.

With `-fstack-reuse=none` we can transform them.

Reply via email to