Unfortunately, I've ran into a second issue where addpd is being performed on memory that isn't 16 byte aligned. Again, this only happens if the createJIT OptLevel is set to Default (vs None).
that will cause a GPF.
I've attached the LLVM IR and a copy of the Disassembly this results in. The crash occurs at 00370872
At the time of the crash, ESP is set to 0018EEF8 - this results in a value is not 16 byte aligned. I notice that the offset is aligned though.
The crash occurs on the first instance of addpd applied to the stack (as I understand ESP is used for).
There is also raises the question of would it be worth requiring alignment of the function stack to improve performance (assuming movapd is faster then movupd). I'm not expecting LLVM to recognize this (although it would be neat) but is this something worth setting ourselves, knowing we're going to be using mostly SSE instructions? And how would we do that?
addpd-unaligned.zip (41.8 KB)