https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115534
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2024-06-18 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed. Note even without vectorizer turned on we get really bad code from the return when expanding (just happens the RTL optimizers can remove the load/stores but not the stack location): ``` ;; return D.4535; (insn 60 59 61 (set (reg:DF 156) (mem/c:DF (plus:DI (reg/f:DI 95 virtual-stack-vars) (const_int -32 [0xffffffffffffffe0])) [4 D.4535+0 S8 A128])) "/app/example.cpp":24:12 -1 (nil)) (insn 61 60 62 (set (reg:DF 157) (mem/c:DF (plus:DI (reg/f:DI 95 virtual-stack-vars) (const_int -24 [0xffffffffffffffe8])) [4 D.4535+8 S8 A64])) "/app/example.cpp":24:12 -1 (nil)) (insn 62 61 63 (set (reg:DF 158) (mem/c:DF (plus:DI (reg/f:DI 95 virtual-stack-vars) (const_int -16 [0xfffffffffffffff0])) [4 D.4535+16 S8 A128])) "/app/example.cpp":24:12 -1 (nil)) (insn 63 62 64 (set (reg:DF 159) (mem/c:DF (plus:DI (reg/f:DI 95 virtual-stack-vars) (const_int -8 [0xfffffffffffffff8])) [4 D.4535+24 S8 A64])) "/app/example.cpp":24:12 -1 (nil)) (insn 64 63 65 (set (reg:DF 132 [ <retval> ]) (reg:DF 156)) "/app/example.cpp":24:12 -1 (nil)) (insn 65 64 66 (set (reg:DF 133 [ <retval>+8 ]) (reg:DF 157)) "/app/example.cpp":24:12 -1 (nil)) (insn 66 65 67 (set (reg:DF 134 [ <retval>+16 ]) (reg:DF 158)) "/app/example.cpp":24:12 -1 (nil)) (insn 67 66 68 (set (reg:DF 135 [ <retval>+24 ]) (reg:DF 159)) "/app/example.cpp":24:12 -1 (nil)) (jump_insn 68 67 69 (set (pc) (label_ref 0)) "/app/example.cpp":24:12 -1 (nil)) ``` On the stack location we get: ``` sub sp, sp, #64 ``` This is why I said there are a few duplicates there ...