https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112090
Bug ID: 112090 Summary: ``(1 >> X) != 0` pattern should be extended to support other constants Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: 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: --- 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`