aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/liveness
diff options
context:
space:
mode:
authorDavid Chase <drchase@google.com>2021-03-10 20:54:11 -0500
committerDavid Chase <drchase@google.com>2021-03-16 19:22:44 +0000
commit0ec2c4abbad7d678ebc4afc4c69af7d952fc3404 (patch)
tree82ab8d9323deb085f5a4d7bd2b44856dfbcc9bf6 /src/cmd/compile/internal/liveness
parent832a01aad409dc0e41eabb53bfdb64d1a41b2c83 (diff)
downloadgo-0ec2c4abbad7d678ebc4afc4c69af7d952fc3404.tar.gz
go-0ec2c4abbad7d678ebc4afc4c69af7d952fc3404.zip
cmd/compile: (fixed) spill output parameters passed in registers as autos
Repair of CL 300749. ALSO: found evidence that stack maps for bodyless methods are wrong. gofmt in test/abi removed never-executed code in types/size.go Updates #44816. Updates #40724. Change-Id: Ifeb5fee60f60e7c7b58ee0457f58a3265d6cf3f6 Reviewed-on: https://go-review.googlesource.com/c/go/+/302071 Trust: David Chase <drchase@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/liveness')
-rw-r--r--src/cmd/compile/internal/liveness/plive.go19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/cmd/compile/internal/liveness/plive.go b/src/cmd/compile/internal/liveness/plive.go
index 48a26cf66a..f3fbb8b9b1 100644
--- a/src/cmd/compile/internal/liveness/plive.go
+++ b/src/cmd/compile/internal/liveness/plive.go
@@ -405,11 +405,17 @@ func (lv *liveness) pointerMap(liveout bitvec.BitVec, vars []*ir.Name, args, loc
}
node := vars[i]
switch node.Class {
+ case ir.PPARAM, ir.PPARAMOUT:
+ if !node.IsOutputParamInRegisters() {
+ if node.FrameOffset() < 0 {
+ lv.f.Fatalf("Node %v has frameoffset %d\n", node.Sym().Name, node.FrameOffset())
+ }
+ typebits.Set(node.Type(), node.FrameOffset(), args)
+ break
+ }
+ fallthrough // PPARAMOUT in registers acts memory-allocates like an AUTO
case ir.PAUTO:
typebits.Set(node.Type(), node.FrameOffset()+lv.stkptrsize, locals)
-
- case ir.PPARAM, ir.PPARAMOUT:
- typebits.Set(node.Type(), node.FrameOffset(), args)
}
}
}
@@ -1083,8 +1089,10 @@ func (lv *liveness) emit() (argsSym, liveSym *obj.LSym) {
for _, n := range lv.vars {
switch n.Class {
case ir.PPARAM, ir.PPARAMOUT:
- if maxArgNode == nil || n.FrameOffset() > maxArgNode.FrameOffset() {
- maxArgNode = n
+ if !n.IsOutputParamInRegisters() {
+ if maxArgNode == nil || n.FrameOffset() > maxArgNode.FrameOffset() {
+ maxArgNode = n
+ }
}
}
}
@@ -1282,6 +1290,7 @@ func isfat(t *types.Type) bool {
return false
}
+// TODO THIS IS ALL WRONG AND NEEDS TO USE ABI.
func WriteFuncMap(fn *ir.Func) {
if ir.FuncName(fn) == "_" || fn.Sym().Linkname != "" {
return