https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80874
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target| |x86_64-linux-gnu Component|tree-optimization |target Keywords| |missed-optimization --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- aarch64 produces the cmov: minmax1(int, int): cmp w0, w1 csel w2, w0, w1, gt csel w0, w1, w0, gt orr x0, x0, x2, lsl 32 ret minmax2(int, int): cmp w0, w1 csel w2, w1, w0, le csel w0, w0, w1, le orr x0, x0, x2, lsl 32 ret Note minmax3 code is not correct itself returns a std::pair<int&,int&>