https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111346
Bug ID: 111346 Summary: `X <= MINMAX` pattern is missing :c on the cmp Product: gcc Version: 14.0 Status: UNCONFIRMED Keywords: internal-improvement, missed-optimization Severity: enhancement Priority: P3 Component: tree-optimization Assignee: pinskia at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- The pattern: ``` /* X <= MAX(X, Y) -> true X > MAX(X, Y) -> false X >= MIN(X, Y) -> true X < MIN(X, Y) -> false */ (for minmax (min min max max ) cmp (ge lt le gt ) (simplify (cmp @0 (minmax:c @0 @1)) { constant_boolean_node (cmp == GE_EXPR || cmp == LE_EXPR, type); } )) ``` Is missing :c on the cmp which causes us to miss: MAX(X, Y) >= X -> true etc.