https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114086
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Now, suppose we optimize the (0xaaaaaaaa >> x) & 1 case etc. provided suitable range of x to x & 1. For int bar3 (int e) { if (e <= 15U) return e & 1; else return 0; } phiopt optimizes this into return e & 1 & (e <= 15U); so, guess we want another match.pd optimization which would turn that into e & -15.