Using DMD 2.065 on Linux x86_64, this
---
struct Foo { double d; }
shared foo = Foo(2.0);
void main() {
import core.atomic, std.stdio;
writeln(atomicLoad(foo));
}
---
prints
---
Foo(3.22526e-319)
---
The issue here is is that Foo is passed in floating point registers under the AMD64 ABI, yet the druntime code only special-cases "raw" floating point numbers to be returned correctly.
Comment #1 by robert.schadek — 2024-12-13T18:21:12Z