From fefae72a53a61c256481328ed29aafb725056f5c Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Fri, 6 Jan 2012 07:45:06 -0800 Subject: [PATCH] fix alignment of registers structure --- src/rt/arch/x86_64/context.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/rt/arch/x86_64/context.h b/src/rt/arch/x86_64/context.h index 5784a4b85fd..bb35486dbc1 100644 --- a/src/rt/arch/x86_64/context.h +++ b/src/rt/arch/x86_64/context.h @@ -21,21 +21,18 @@ T align_down(T sp) // The struct in which we store the saved data. This is mostly the // volatile registers and instruction pointer, but it also includes // RCX/RDI which are used to pass arguments. The indices for each -// register are found in "regs.h": +// register are found in "regs.h". Note that the alignment must be +// 16 bytes so that SSE instructions can be used. #include "regs.h" struct registers_t { uint64_t data[RUSTRT_MAX]; -}; +} __attribute__((aligned(16))); extern "C" void __morestack(void *args, void *fn_ptr, uintptr_t stack_ptr); class context { public: -#ifdef __FreeBSD__ - registers_t regs __attribute__((aligned(16))); -#else registers_t regs; -#endif context(); -- 2.44.0