https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107208
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|[aarch64] llvm generate |[aarch64] _complex integer |better code than gcc base |return types could be |on _Complex type mul |improved Component|rtl-optimization |middle-end Last reconfirmed| |2022-10-11 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Yes it is due to return value and how it is done: (insn 32 28 33 2 (clobber (reg/i:CDI 0 x0)) "/app/example.cpp":6:1 -1 (nil)) (insn 33 32 34 2 (set (reg:DI 0 x0) (reg:DI 102 [ <retval> ])) "/app/example.cpp":6:1 -1 (nil)) (insn 34 33 35 2 (set (reg:DI 1 x1 [+8 ]) (reg:DI 103 [ <retval>+8 ])) "/app/example.cpp":6:1 -1 (nil)) (insn 35 34 0 2 (use (reg/i:CDI 0 x0)) "/app/example.cpp":6:1 -1 (nil)) So this is not _Complex integer multiplies at all but rather just the return values and the register allocator. I wonder why Complex float is expanded slightly differently (and better here): (insn 34 33 35 2 (set (reg:SF 32 v0) (reg:SF 115)) "/app/example.cpp":6:1 -1 (nil)) (insn 35 34 36 2 (set (reg:SF 33 v1) (reg:SF 118)) "/app/example.cpp":6:1 -1 (nil)) (insn 36 35 37 2 (use (reg:SF 32 v0)) "/app/example.cpp":6:1 -1 (nil)) (insn 37 36 0 2 (use (reg:SF 33 v1)) "/app/example.cpp":6:1 -1 (nil)) Who chose CDI for the integer case but a pair of SF for the float case ...