https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117477
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Both are the same. Gcc choices a stack location rather than a calee save register which is also saved/restored from the stackq. The cost of knowing that using another callee saved register is not known to be almost free with the stp/ldp instructions might not be taken into account. I suspect you could make a case where gcc does the right thing and llvms register allocator still goes for the callee saved register