]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal-abi: fix ABI0-equivalence for zero-sized values
authorAustin Clements <austin@google.com>
Wed, 24 Feb 2021 01:48:22 +0000 (20:48 -0500)
committerAustin Clements <austin@google.com>
Wed, 24 Feb 2021 19:26:13 +0000 (19:26 +0000)
commit80ddc17ae1b3ffacc42c19b999956f9ccef3ddd1
treefba28032dc089a768e42bcaebabcf8e3a8bec8c9
parent3deb528199383b39425fc99f3741a6ade6ab5a6b
cmd/compile/internal-abi: fix ABI0-equivalence for zero-sized values

This fixes a bug in the internal ABI specification that made it not
equivalent to ABI0 even with zero architectural argument registers in
the case of a zero-sized argument with alignment > 1.

In ABI0, even zero-sized arguments cause alignment padding in the
stack frame.

Currently, in the internal ABI, zero-sized arguments get
register-assigned even if there are no registers because they don't
consume any registers. Hence, they don't create alignment padding in
the stack frame.

Fix this by stack-assigning zero-sized arguments.

For #40724.

Change-Id: I1f5a95a94fed8b5313a360e5e76875701ba5f562
Reviewed-on: https://go-review.googlesource.com/c/go/+/295791
Trust: Austin Clements <austin@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/compile/internal-abi.md