The x86-64 ABI mandates in section 3.2.2 that (%rsp + 8) is always a
multiple of 16 when control is transferred to a function entry point. We
did not correctly implement this convention which resulted in broken
alignment for stack variables, and, following from that, SSE
instructions generated by GCC faulting due to bad alignment.
For the x86-32 version the alignment constraint appears to be[1] that
%esp must be a multiple of 16, this is already the case so no change is
made to x86-32.s.
[1] http://sourceforge.net/p/fbc/bugs/659/,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38496
Signed-off-by: Martin Lucina <martin@lucina.net>
ENTRY(thread_starter)
popq %rdi
popq %rbx
+ pushq $0 /* correct stack alignment for SSE */
pushq $0
xorq %rbp,%rbp
call *%rbx