diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp index 324d7e91f77..ae90c2edc7f 100644 --- a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp +++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp @@ -161,8 +161,14 @@ __asm__ ( * is assumed and required, e.g. by GCC4's -ftree-vectorize option. */ "andl $0xfffffff0, %ecx\n\t" /* drop(?) stack ptr to 128-bit align */ - "subl $8, %ecx\n\t" /* lower again; push/call below will re-align */ - +/* $esp should be aligned to a 16-byte boundary here (note we include an + * additional 4 bytes in a later push instruction). This will ensure $ebp + * in the function called below is aligned to a 0x8 boundary. SSE instructions + * like movapd/movdqa expect memory operand to be aligned on a 16-byte + * boundary. The GCC compiler will generate the memory operand using $ebp + * with an 8-byte offset. + */ + "subl $0xc, %ecx\n\t" /* lower again; push/call below will re-align */ "movl %ecx, %esp\n\t" /* make stack space */ "movl 0x14(%ebp), %edx\n\t" "call " SYMBOL_UNDERSCORE "invoke_copy_to_stack\n\t"