I try to build an application which uses pthreads and __m128 SSE type. According to GCC manual, default stack alignment is 16 bytes. In order to use __m128, the requirement is t
Sorry to resurrect an old thread...
For those with a newer compiler than OP, OP mentions a -mstackrealign
option, which lead me to __attribute__((force_align_arg_pointer))
. If your function is being optimized to use SSE, but %ebp
is misaligned, this will do the runtime fixes if required for you, transparently. I also found out that this is only an issue on i386
. The x86_64
ABI guarantees the arguments are aligned to 16 bytes.
__attribute__((force_align_arg_pointer))
void i_crash_when_not_aligned_to_16_bytes() {
...
}
Cool article for those who might want to learn more: http://wiki.osdev.org/System_V_ABI