https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106164
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I think I have a better patch. There are patterns for: Convert (X OP1 CST1) || (X OP2 CST2). externding them easily to support: Convert (X OP1 Y) || (X OP2 Y). is a few lines. Don't even need to call combine_comparisons either. Once I test it I will submit the patch.