https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126705
Bug ID: 126705
Summary: `ctz(a*3)` should be simplified into `ctz(a)`
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: easyhack, 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: ---
The number of trailing zeros does not change if multiplying by an odd number.
For an example 3*a will have the same # of trailing zeros as a has.
Example:
```
unsigned f(unsigned t)
{
return __builtin_ctz(t*3);
}
```