Just found an old bug. Atomics modify immutable data: --- import ldc.intrinsics; void f(immutable int* a) { llvm_atomic_rmw_add(a,1); } ---