From 593f5bbad7727f57ce452c4aa93604e8dabbba7d Mon Sep 17 00:00:00 2001 From: eric fang Date: Wed, 4 Nov 2020 09:26:28 +0000 Subject: [PATCH] cmd/compile: adjust stack slot alignment requirements on arm64 Currently any variable that is spilled onto the stack will occupy at least 8 bytes, because the stack offset is required to be aligned with 8 bytes on linux/arm64. This CL removes this constraint by aligning the stack slot with its actual size. Updates #42385 Change-Id: Icbd63dc70cd19852802e43f134355f19ba7e1e29 Reviewed-on: https://go-review.googlesource.com/c/go/+/267999 Trust: eric fang Reviewed-by: Cherry Zhang --- src/cmd/compile/internal/ssagen/pgen.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/ssagen/pgen.go b/src/cmd/compile/internal/ssagen/pgen.go index b675d1c876..7e15f54299 100644 --- a/src/cmd/compile/internal/ssagen/pgen.go +++ b/src/cmd/compile/internal/ssagen/pgen.go @@ -138,7 +138,7 @@ func (s *ssafn) AllocFrame(f *ssa.Func) { } else { lastHasPtr = false } - if Arch.LinkArch.InFamily(sys.ARM, sys.ARM64, sys.PPC64) { + if Arch.LinkArch.InFamily(sys.ARM, sys.PPC64) { s.stksize = types.Rnd(s.stksize, int64(types.PtrSize)) } n.SetFrameOffset(-s.stksize)