https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79593
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- With -Ofast -m32 -mfpmath=i387 it changed with r244816. Why do you care about 32-bit code performance (and especially x87)? That is pure legacy, people who care about performance should be using -m64 or at least -msse2 -mfpmath=sse (unless you need long double). What I said still applies, the reason why the combiner doesn't optimize it is that it has more than one use, which only goes away at regstack time and there is no peephole afterwards that could improve it.