https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115547
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://github.com/llvm/llv | |m-project/issues/95946 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Note sometimes it can get complex for bool case: ``` bool fn1(bool a, bool b, bool c) { return a != c && (b || (c || a)); } bool fn2(bool a, bool b, bool c) { return a != c && (b || c || a); } bool fn3(bool a, bool b, bool c) { return a != c && (a || b || c); } bool fn4(bool a, bool b, bool c) { return a != c && (a || c || b); } ``` The above is from https://github.com/llvm/llvm-project/issues/95946 . For those we have: ``` <bb 2> [local count: 1073741824]: if (a_3(D) != c_4(D)) goto <bb 3>; [66.00%] else goto <bb 4>; [34.00%] <bb 3> [local count: 708669600]: _8 = c_4(D) | b_5(D); _7 = a_3(D) | _8; <bb 4> [local count: 1073741824]: # iftmp.0_2 = PHI <_7(3), 0(2)> return iftmp.0_2; ``` Which really we know that (a|c) will be 1. But maybe that is a different issue all together.