aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/expand_calls.go
diff options
context:
space:
mode:
authorDavid Chase <drchase@google.com>2021-04-05 09:47:22 -0400
committerDavid Chase <drchase@google.com>2021-04-05 20:11:08 +0000
commitee40bb666bed55e7232c50a980e238aed7a32e0c (patch)
tree374bf6b76fa4cacb5baa9df35023342e6968719c /src/cmd/compile/internal/ssa/expand_calls.go
parent254fb85c12aa631b5d1596aaf13f6e8666d65d15 (diff)
downloadgo-ee40bb666bed55e7232c50a980e238aed7a32e0c.tar.gz
go-ee40bb666bed55e7232c50a980e238aed7a32e0c.zip
cmd/compile: add "surprised by IData of Arg" case for register args
This fixes a compile crash for GOEXPERIMENT=regabi,regabiargs go test -c go/constant Updates #40724. Change-Id: I238cef436e045647815326fc8fdb025c30ba1f5c Reviewed-on: https://go-review.googlesource.com/c/go/+/307309 Trust: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/expand_calls.go')
-rw-r--r--src/cmd/compile/internal/ssa/expand_calls.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/expand_calls.go b/src/cmd/compile/internal/ssa/expand_calls.go
index b6683d076d..6a6517deb8 100644
--- a/src/cmd/compile/internal/ssa/expand_calls.go
+++ b/src/cmd/compile/internal/ssa/expand_calls.go
@@ -317,6 +317,15 @@ func (x *expandState) rewriteSelect(leaf *Value, selector *Value, offset int64,
}
}
switch selector.Op {
+ case OpArgIntReg, OpArgFloatReg:
+ if leafType == selector.Type { // OpIData leads us here, sometimes.
+ leaf.copyOf(selector)
+ } else {
+ x.f.Fatalf("Unexpected %s type, selector=%s, leaf=%s\n", selector.Op.String(), selector.LongString(), leaf.LongString())
+ }
+ if x.debug {
+ x.Printf("---%s, break\n", selector.Op.String())
+ }
case OpArg:
if !x.isAlreadyExpandedAggregateType(selector.Type) {
if leafType == selector.Type { // OpIData leads us here, sometimes.