https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89984
Bug ID: 89984 Summary: Extra register move Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com Target Milestone: --- Target: x86-64,i386 [hjl@gnu-cfl-1 xxx]$ cat x.i float check_f_pos (float x, float y) { return x * __builtin_copysignf (1.0f, y); } [hjl@gnu-cfl-1 xxx]$ cat x.i float check_f_pos (float x, float y) { return x * __builtin_copysignf (1.0f, y); } [hjl@gnu-cfl-1 xxx]$ make /export/build/gnu/tools-build/gcc-wip-debug/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/tools-build/gcc-wip-debug/build-x86_64-linux/gcc/ -mavx2 -O2 -S x.i [hjl@gnu-cfl-1 xxx]$ cat x.s .file "x.i" .text .p2align 4 .globl check_f_pos .type check_f_pos, @function check_f_pos: .LFB0: .cfi_startproc vandps .LC0(%rip), %xmm1, %xmm1 vxorps %xmm0, %xmm1, %xmm1 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Why not just do vxorps %xmm0, %xmm1, %xmm0 vmovaps %xmm1, %xmm0 ret .cfi_endproc .LFE0: .size check_f_pos, .-check_f_pos .section .rodata.cst16,"aM",@progbits,16 .align 16 .LC0: .long 2147483648 .long 0 .long 0 .long 0 .ident "GCC: (GNU) 9.0.1 20190403 (experimental)" .section .note.GNU-stack,"",@progbits [hjl@gnu-cfl-1 xxx]$