https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110949
Bug ID: 110949 Summary: ((cast)cmp) - 1 should be tranformed into (cast)cmp` where cmp` is the inverse of cmp Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- Take: ``` int f1(int a, int t) { auto _6 = a == 115; auto _7 = (signed int) _6; return _6 - 1; } ``` This should be the same as: ``` int f2(int a, int t) { auto _6 = a != 115; auto _7 = (signed int) _6; return -_6; } ```