]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.20] cmd/compile: in expandCalls, move all arg marshalling into...
authorDavid Chase <drchase@google.com>
Tue, 15 Aug 2023 21:45:50 +0000 (17:45 -0400)
committerCarlos Amedee <carlos@golang.org>
Thu, 24 Aug 2023 21:11:06 +0000 (21:11 +0000)
commit612da32fb5e9c1e9641cd55dc269518426057ea9
tree4000c174248db79bb5bb4241cdcf201fde757c72
parentf0b8768dbcf74bddedc32febd36732beb690b8aa
[release-branch.go1.20] cmd/compile: in expandCalls, move all arg marshalling into call block

For aggregate-typed arguments passed to a call, expandCalls
decomposed them into parts in the same block where the value
was created.  This is not necessarily the call block, and in
the case where stores are involved, can change the memory
leaving that block, and getting that right is problematic.

Instead, do all the expanding in the same block as the call,
which avoids the problems of (1) not being able to reorder
loads/stores across a block boundary to conform to memory
order and (2) (incorrectly, not) exposing the new memory to
consumers in other blocks.  Putting it all in the same block
as the call allows reordering, and the call creates its own
new memory (which is already dealt with correctly).

Fixes #62056.
Updates #61992.

Change-Id: Icc7918f0d2dd3c480cc7f496cdcd78edeca7f297
Reviewed-on: https://go-review.googlesource.com/c/go/+/519276
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
(cherry picked from commit e72ecc6a6becab9ca895c0108047db4723394296)
Reviewed-on: https://go-review.googlesource.com/c/go/+/520059
src/cmd/compile/internal/ssa/expand_calls.go
test/fixedbugs/issue61992.go [new file with mode: 0644]