Code: void test() { Point p; if (p.f != 0.0) assert(0); } struct Point { float f = 0.0; double g = 0.0; } Compile with -O -m64 on Linux, and the code for test() is: push RBP mov RBP,RSP sub RSP,010h lea RAX,-010h[RBP] xor ECX,ECX mov [RAX],RCX mov 8[RAX],RCX fld float ptr -010h[RBP] fldz fucomip <--- using x87 fstp ST jne L25 mov RSP,RBP pop RBP ret L25: mov ESI,5 mov EDI,offset FLAT:_TMP0@32 call _d_assertp@PC32 mov RSP,RBP pop RBP ret It should be using XMM instructions instead.
@WalterBright created dlang/dmd pull request #12448 "fix Issue 21835 - Operation on float should use XMM register, not x87" fixing this issue: - fix Issue 21835 - Operation on float should use XMM register, not x87 https://github.com/dlang/dmd/pull/12448
dlang/dmd pull request #12448 "fix Issue 21835 - Operation on float should use XMM register, not x87" was merged into master: - a4e85cfa4f080d0df466999c4b5b68546866ed25 by Walter Bright: fix Issue 21835 - Operation on float should use XMM register, not x87 https://github.com/dlang/dmd/pull/12448