https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89360
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2021-08-19 Component|rtl-optimization |tree-optimization Severity|normal |enhancement --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed, with GCC 11+ we get close for sort2_if: cmpl %esi, %edi jl .L4 movl %esi, %eax movl %edi, %esi movl %eax, %edi .L4: movl %edi, (%rdx) movl %esi, (%rcx) GCC 9+ produces the cmov for sort2_ternary due to r9-3606. We don't recongize the MIN/MAX in sort2_if as phiopt only handles the case where there is only phi node which differs.