1
0
mirror of https://github.com/golang/go synced 2024-11-17 10:04:43 -07:00

cmd/compile: enable late expansion for address-of static calls

passes run.bash and race.bash (on Darwin-amd64)

Change-Id: I2abda9636b681d050e85e88fc357ebe5220d2ba2
Reviewed-on: https://go-review.googlesource.com/c/go/+/246938
Trust: David Chase <drchase@google.com>
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
David Chase 2020-08-05 11:42:44 -04:00
parent ad8447bed9
commit 75ea9953a8

View File

@ -4376,7 +4376,7 @@ func (s *state) call(n *Node, k callKind, returnResultAddr bool) *ssa.Value {
case OCALLFUNC:
if k == callNormal && fn.Op == ONAME && fn.Class() == PFUNC {
sym = fn.Sym
if !returnResultAddr && ssa.LateCallExpansionEnabledWithin(s.f) {
if ssa.LateCallExpansionEnabledWithin(s.f) {
testLateExpansion = true
}
break
@ -4393,7 +4393,7 @@ func (s *state) call(n *Node, k callKind, returnResultAddr bool) *ssa.Value {
}
if k == callNormal {
sym = fn.Sym
if !returnResultAddr && ssa.LateCallExpansionEnabledWithin(s.f) {
if ssa.LateCallExpansionEnabledWithin(s.f) {
testLateExpansion = true
}
break
@ -4605,7 +4605,11 @@ func (s *state) call(n *Node, k callKind, returnResultAddr bool) *ssa.Value {
}
fp := res.Field(0)
if returnResultAddr {
return s.constOffPtrSP(types.NewPtr(fp.Type), fp.Offset+Ctxt.FixedFrameSize())
pt := types.NewPtr(fp.Type)
if testLateExpansion {
return s.newValue1I(ssa.OpSelectNAddr, pt, 0, call)
}
return s.constOffPtrSP(pt, fp.Offset+Ctxt.FixedFrameSize())
}
if testLateExpansion {