https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93131
--- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Dunno about others, but this particular optimization could be done in a new function called next to optimize_range_tests_cmp_bitwise and optimize_range_tests_var_bound because reassoc already has a framework to deal with the && and || across different bbs as well as inside of them.