https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106138
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amacleod at redhat dot com --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- So we're seeing b1_8 = x_7(D) == 4; # RANGE [0, 3] NONZERO 3 _3 = x_7(D) & 3; b2_9 = _3 != 0; _5 = b1_8 & b2_9; and fail to optimize that. It somewhat looks like "relations" (on x_7), but I'm not sure if suitable to handle for ranger. Adding something in match.pd might be possible - the key is of course that both b1 and b2 are derived from the same value. I think we already have a pattern looking at not intersecting nonzero bits.