https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96694
Bug ID: 96694 Summary: Failure to optimize min/max pattern using two binary nots to min/max pattern using one binary not Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: gabravier at gmail dot com Target Milestone: --- int f(int x, int y) { return ~((~x > y) ? ~x : y); } This can be optimized to `return ((~y <= x) ? ~y : x);`. This transformation is done by LLVM, but not by GCC.