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

            Bug ID: 115547
           Summary: `(a ^ c) & (a | c)` -> `a ^ c` not done on the
                    gimple/tree level
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, TREE
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
```
bool fn5(bool a, bool c) {
    return a != c && (a || c);
}
int fn6(int a, int c) {
    return (a ^ c) & (a | c);
}
```

these 2 are optimized to (a^c) on the RTL level only (well fn5 is not done for
aarch64). We should be able to optimize them on the gimple level too.

Reply via email to