I had a mysterious x86-based bus error (32-bit) when running code compiled with gcc-4.8.1 with -march=pentium4 . I traced the issue with the SSE instruction:
movdqa %xmm5,0x50(%esp)
with esp = 0xbfffedac. movdqa requires the address to be 16 byte aligned, which is not the case here, so a bus error.
The problem does not occur when compiling with -march=native (this is a Core-i3 processor).
As far as I know, the only stack alignment guaranteed on Linux / x86 is 4 bytes. Thus, it seems odd that the code generator should select movdqa without any alignment check, even if there is a movdqu command for possibly low access.
So it looks like there is an error in gcc.
I am not an expert on SSE and x86 ABI, and I will be grateful for the feedback before submitting a bug report.
gcc x86 linux sse
David monniaux
source share