https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118660
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- This one is slightly harder to handle: ``` unsigned short f(unsigned a) { if ((a & 3) != 3) return a & 1; return a & 1; } ``` We get: ``` <bb 2> [local count: 1073741824]: _1 = a_4(D) & 3; if (_1 != 3) goto <bb 3>; [50.00%] else goto <bb 4>; [50.00%] <bb 3> [local count: 536870912]: _2 = (short unsigned int) a_4(D); _5 = _2 & 1; <bb 4> [local count: 1073741824]: # _3 = PHI <_5(3), 1(2)> ``` I suspect for this one, we need to add an extra code to phi-opt to allow for an optional conversion too. NOTE I would say this should be deffered until GCC 16 since now both GCC and LLVM have the same issue and I doubt it was noticed in real code.