https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128894
Bug ID: 128894
Summary: `-(CST << x)` can be simplified to `-CST << x` at the
gimple level
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: easyhack, 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: ---
This is missing at the gimple level, the RTL level we do the correct thing.
```
int src(int x)
{
return -(2 << x);
}
int tgt(int x)
{
return (-2) << x;
}
```
These 2 we should simplify into the same thing by optimized comes along.