aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types/size.go
diff options
context:
space:
mode:
authorDavid Chase <drchase@google.com>2021-03-15 21:12:08 +0000
committerDavid Chase <drchase@google.com>2021-03-15 21:28:45 +0000
commite61c9ddb7f1a790f6a52f563dccb4ac264f2e704 (patch)
treecf3c49cf8575bfe24eb7fae5b66220f274e6ba95 /src/cmd/compile/internal/types/size.go
parent8ed438c077d82c4b4662c327dbbdb3c64e7547ca (diff)
downloadgo-e61c9ddb7f1a790f6a52f563dccb4ac264f2e704.tar.gz
go-e61c9ddb7f1a790f6a52f563dccb4ac264f2e704.zip
Revert "cmd/compile: spill output parameters passed in registers as autos"
This reverts commit 8ed438c077d82c4b4662c327dbbdb3c64e7547ca, CL 300749. Reason for revert: Looks like it crashes on link-register architectures Change-Id: I0c261df58900008cada3359889d2a87508158447 Reviewed-on: https://go-review.googlesource.com/c/go/+/302053 Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types/size.go')
-rw-r--r--src/cmd/compile/internal/types/size.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/types/size.go b/src/cmd/compile/internal/types/size.go
index a75429f0ab..ef23cdf5fe 100644
--- a/src/cmd/compile/internal/types/size.go
+++ b/src/cmd/compile/internal/types/size.go
@@ -163,9 +163,19 @@ func calcStructOffset(errtype *Type, t *Type, o int64, flag int) int64 {
if f.Type.Align > 0 {
o = Rnd(o, int64(f.Type.Align))
}
- if isStruct { // For receiver/args/results, do not set, it depends on ABI
+ if isStruct { // For receiver/args/results, depends on ABI
f.Offset = o
}
+ if f.Nname != nil {
+ // addrescapes has similar code to update these offsets.
+ // Usually addrescapes runs after calcStructOffset,
+ // in which case we could drop this,
+ // but function closure functions are the exception.
+ // NOTE(rsc): This comment may be stale.
+ // It's possible the ordering has changed and this is
+ // now the common case. I'm not sure.
+ f.Nname.(VarObject).RecordFrameOffset(o)
+ }
w := f.Type.Width
if w < 0 {