[PATCH] [20/45] x86_64: Use 8 byte stack alignment when possible

Andi Kleen
2007-09-21T20:51:27Z

Kernel doesn't use SSE2, so it doesn't need 16 byte alignment. Also
the stack can be already unaligned so letting the compiler align
is useless. This may make some stack frames smaller.
Only works with very recent gcc 4.3
Signed-off-by: Andi Kleen <ak@suse.de>

---
arch/x86_64/Makefile | 2 ++
1 file changed, 2 insertions(+)

Index: linux/arch/x86_64/Makefile
===================================================================
--- linux.orig/arch/x86_64/Makefile
+++ linux/arch/x86_64/Makefile
@@ -49,6 +49,8 @@ CFLAGS += $(call cc-option,-mno-sse -mno
# newer gccs do it by default
CFLAGS += -maccumulate-outgoing-args

+CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3)
+
# do binutils support CFI?
CFLAGS += $(call as-instr,.cfi_startproc\n.cfi_rel_offset rsp${comma}0\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_rel_offset rsp${comma}0\n.cfi_endproc,-DCONFIG_AS_CFI=1,)