https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91526
--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The difference between GCC 12 and 13 is: GCC 12: ``` ;; <retval> = result; (insn 12 11 13 (set (reg:TI 91) (mem/c:TI (plus:DI (reg/f:DI 77 virtual-stack-vars) (const_int -32 [0xffffffffffffffe0])) [2 resultD.2491+0 S16 A256])) "/app/example.cpp":8:12 -1 (nil)) (insn 13 12 14 (set (mem/c:TI (reg/f:DI 85 [ .result_ptrD.2520 ]) [2 <retval>+0 S16 A32]) (reg:TI 91)) "/app/example.cpp":8:12 -1 (nil)) (insn 14 13 15 (set (reg:TI 92) (mem/c:TI (plus:DI (reg/f:DI 77 virtual-stack-vars) (const_int -16 [0xfffffffffffffff0])) [2 resultD.2491+16 S16 A128])) "/app/example.cpp":8:12 -1 (nil)) (insn 15 14 0 (set (mem/c:TI (plus:DI (reg/f:DI 85 [ .result_ptrD.2520 ]) (const_int 16 [0x10])) [2 <retval>+16 S16 A32]) (reg:TI 92)) "/app/example.cpp":8:12 -1 (nil)) ``` vs: GCC 13: ``` (insn 12 11 13 (set (reg:OI 91) (mem/c:OI (plus:DI (reg/f:DI 77 virtual-stack-vars) (const_int -32 [0xffffffffffffffe0])) [2 resultD.3251+0 S32 A256])) "/app/example.cpp":8:12 -1 (nil)) (insn 13 12 0 (set (mem/c:OI (reg/f:DI 85 [ .result_ptrD.3280 ]) [2 <retval>+0 S32 A32]) (reg:OI 91)) "/app/example.cpp":8:12 -1 (nil)) ``` Looks like how the copy was done into the return location.