https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99069
Bug ID: 99069 Summary: Failure to optimize bool selection pattern 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: --- bool f(bool x, bool y) { return (x ? y : false) ? x : false; } This can be optimized to `return x & y;`. This transformation is done by LLVM, but not by GCC.