[Bug tree-optimization/126453] New: phiopt should combine phis in some cases

"pinskia at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.