Two types of structures: struct TestFloat { float x; }; struct TestDouble { double x; }; are passed and returned via SSE registers which is wrong in Windows x86-64 ABI. According to Microsoft documentation: http://msdn.microsoft.com/en-us/library/zthk2dkh.aspx http://msdn.microsoft.com/en-us/library/7572ztz4.aspx and code generated by MSVS2013 analysis, this kind of structures should be passed via integer registers (RCX, RDX, R8, and R9) and returned in RAX register.
*** Bug 86727 has been marked as a duplicate of this bug. ***
Any chance that this can be upgraded to "confirmed"? Seems this has been around for a while...
We are still having this issue, it now manifests in cross-compiled binaries used in the Julia ecosystem, see: https://github.com/JuliaPackaging/BinaryBuilder.jl/issues/315
Adding CC.
This is fixed in gcc-11: --cut here-- struct TestFloat { float x; }; struct TestDouble { double x; }; struct TestFloat foo (struct TestFloat x) { return x; } struct TestDouble bar (struct TestDouble x) { return x; } --cut here-- gcc -O2: foo: movl %ecx, %eax ret bar: movq %rcx, %rax ret
Fixed in gcc-9.
Thanks, confirmed that this is also working on GCC 10.2. Unfortunately the latest in our compiler images is 9.1, and that seems to be still affected, so we'll have to upgrade.