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

            Bug ID: 118649
           Summary: `(b * CST) & 1` for CST is odd is not optimized to
                    `b&1` on the gimple level
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, TREE
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: pinskia at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
```
int f(int a)
{
  int b = a * 3;
  return b & 1;
}
```

This can be optimized to just `a & 1` which is done on the RTL level but not
the gimple level.

Notice this while looking into PR 118638.

Reply via email to