https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85667
H.J. Lu <hjl.tools at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED |--- --- Comment #10 from H.J. Lu <hjl.tools at gmail dot com> --- The bug isn't fixed: [hjl@gnu-cfl-1 tmp]$ cat x.c typedef struct { float x; } Float; Float __attribute__((ms_abi)) fn1(Float x, Float y) { Float v; v.x = x.x + y.x; return v; } [hjl@gnu-cfl-1 tmp]$ gcc -S -O2 x.c [hjl@gnu-cfl-1 tmp]$ cat x.s .file "x.c" .text .p2align 4 .globl fn1 .type fn1, @function fn1: .LFB0: .cfi_startproc addss %xmm1, %xmm0 <<<<< Wrong registers are used. movd %xmm0, %eax ret .cfi_endproc .LFE0: .size fn1, .-fn1 .ident "GCC: (GNU) 9.2.1 20200123 (Red Hat 9.2.1-3)" .section .note.GNU-stack,"",@progbits [hjl@gnu-cfl-1 tmp]$ clang -S -O2 x.c [hjl@gnu-cfl-1 tmp]$ cat x.s .text .file "x.c" .globl fn1 # -- Begin function fn1 .p2align 4, 0x90 .type fn1,@function fn1: # @fn1 .cfi_startproc # %bb.0: movd %ecx, %xmm0 movd %edx, %xmm1 addss %xmm0, %xmm1 movd %xmm1, %eax retq .Lfunc_end0: .size fn1, .Lfunc_end0-fn1 .cfi_endproc # -- End function .ident "clang version 9.0.0 (Fedora 9.0.0-1.fc31)" .section ".note.GNU-stack","",@progbits .addrsig [hjl@gnu-cfl-1 tmp]$