https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101706
Bug ID: 101706 Summary: bool0^bool1^1 -> bool0 == bool1 Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- void fa(bool &a, bool &b, bool &c) { c= a==b; } void fb(bool &a, bool &b, bool &c) { int t = (a^b); c= (t^1); } I don't know how often this shows up but I am putting this here for completeness.