https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113379
Bug ID: 113379 Summary: `MIN<a,b> == MAX<a,b>` should be optimzed to `a == b` 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 f(int a, int b) { int c = a > b ? a : b; int d = a < b ? a : b; return c == d; } ``` This should be optimized to `a == b;` Likewise for the `!=` case too.