The following code causes a segfault when compiled with dmd v2.063.2 without any
flags:
import core.simd;
void store(float4* p, float4 a) { *p = a; }
void main()
{
float4 a, b;
store(&a, b);
}
Disassembly of store():
push %rbp
mov %rsp,%rbp
sub $0x20,%rsp
movaps %xmm0,-0x18(%rbp)
movaps -0x18(%rbp),%xmm1
movaps %xmm1,(%rdi)
leaveq
retq
The segfault happens at the first movaps. The value in rbp is aligned to 16 bytes, so rbp - 0x18 is not.