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

            Bug ID: 126453
           Summary: phiopt should combine phis in some cases
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
```
int g(bool, bool);

int f(int b)
{
  bool tb;
  int ti;
  if (b) ti = 0, tb = 1; else ti = 1, tb = 0;
  return g(tb, ti);
}
int f1(int b)
{
  bool tb;
  if (b) tb = 1; else tb = 0;
  return g(tb, !tb);
}
```

phiopt should notice that ti and tb are just ~ of each other with a cast. and
move that out for ti. Leaving tb.

Reply via email to