Bug 11155 – Wrong SIMD code generated (unaligned movaps)

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2013-10-01T16:08:00Z
Last change time
2013-11-08T09:19:47Z
Assigned to
nobody
Creator
jerro.public

Comments

Comment #0 by jerro.public — 2013-10-01T16:08:03Z
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.
Comment #1 by bugzilla — 2013-11-07T17:13:42Z
Comment #2 by github-bugzilla — 2013-11-08T09:19:37Z