Bug 112090

Summary: ``(1 >> X) != 0` pattern should be extended to support other constants
Product: gcc Reporter: Andrew Pinski <pinskia>
Component: tree-optimizationAssignee: Andrew Pinski <pinskia>
Status: ASSIGNED ---    
Severity: enhancement CC: gabravier
Priority: P3 Keywords: missed-optimization
Version: 14.0   
Target Milestone: ---   
See Also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105832
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2023-10-25 00:00:00

Description Andrew Pinski 2023-10-25 22:17:52 UTC
We could extend it to support power of 2 constants or more.

Example:
```
int f(int a)
{
  return 2 != (2 >> a);
}
```

This could be optimized to `a != 0`