From: Cherry Zhang Date: Wed, 7 Oct 2020 15:32:43 +0000 (-0400) Subject: cmd/compile: store call args in the call block X-Git-Tag: go1.16beta1~818 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ccf89bef43f3580526019e0804e91352e62047d5;p=gostls13.git cmd/compile: store call args in the call block We already do this for OpStore, but we didn't do this for OpMove. Do the same, to ensure that no two memories are live at the same time. Fixes #41846. Change-Id: Iad77ff031b3c4459d1217e0b04aeb0e692eb474d Reviewed-on: https://go-review.googlesource.com/c/go/+/260237 Trust: Cherry Zhang Run-TryBot: Cherry Zhang TryBot-Result: Go Bot Reviewed-by: David Chase --- diff --git a/src/cmd/compile/internal/ssa/expand_calls.go b/src/cmd/compile/internal/ssa/expand_calls.go index 992936b2d3..8c06040542 100644 --- a/src/cmd/compile/internal/ssa/expand_calls.go +++ b/src/cmd/compile/internal/ssa/expand_calls.go @@ -283,7 +283,7 @@ func expandCalls(f *Func) { // TODO this will be more complicated with registers in the picture. src := a.Args[0] dst := f.ConstOffPtrSP(src.Type, aux.OffsetOfArg(auxI), sp) - if a.Uses == 1 { + if a.Uses == 1 && a.Block == v.Block { a.reset(OpMove) a.Pos = pos a.Type = types.TypeMem @@ -292,7 +292,7 @@ func expandCalls(f *Func) { a.SetArgs3(dst, src, mem) mem = a } else { - mem = a.Block.NewValue3A(pos, OpMove, types.TypeMem, aux.TypeOfArg(auxI), dst, src, mem) + mem = v.Block.NewValue3A(pos, OpMove, types.TypeMem, aux.TypeOfArg(auxI), dst, src, mem) mem.AuxInt = aux.SizeOfArg(auxI) } } else {