https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117612
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- For -O2 -ffast-math this is optimized partially in phiopt (turns that a != b ? a < b : 0 into (a != b) & (a < b)) and reassoc, which simplifies the latter into just a < b.