aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2021-01-16 22:27:23 -0800
committerMatthew Dempsky <mdempsky@google.com>2021-01-17 07:23:00 +0000
commite3027c6828230d01089afec0ab958040ba326abc (patch)
treebb377e33d881546c6fcf84b2e903b4fba508c621 /src
parent59ff93fe645320c7d6a434ea7794546e89b12d45 (diff)
downloadgo-e3027c6828230d01089afec0ab958040ba326abc.tar.xz
[dev.regabi] cmd/compile: fix linux-amd64-noopt builder
CL 284223 tightened down the allowed expressions in mayCall, but evidently a little too tight. The linux-amd64-noopt builder does in fact see expressions with non-empty Init lists in arguments list. Since I believe these can only appear on the RHS of LogicalExpr expressions, this CL relaxes that one case. Change-Id: I1e6bbd0449778c40ed2610b3e1ef6a825a84ada7 Reviewed-on: https://go-review.googlesource.com/c/go/+/284226 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/compile/internal/walk/walk.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/walk/walk.go b/src/cmd/compile/internal/walk/walk.go
index f214551617..399fb2462b 100644
--- a/src/cmd/compile/internal/walk/walk.go
+++ b/src/cmd/compile/internal/walk/walk.go
@@ -305,6 +305,14 @@ func mayCall(n ir.Node) bool {
// before we start marshaling args for a call. See issue 16760.
return true
+ case ir.OANDAND, ir.OOROR:
+ n := n.(*ir.LogicalExpr)
+ // The RHS expression may have init statements that
+ // should only execute conditionally, and so cannot be
+ // pulled out to the top-level init list. We could try
+ // to be more precise here.
+ return len(n.Y.Init()) != 0
+
// When using soft-float, these ops might be rewritten to function calls
// so we ensure they are evaluated first.
case ir.OADD, ir.OSUB, ir.OMUL, ir.ONEG:
@@ -318,7 +326,6 @@ func mayCall(n ir.Node) bool {
case ir.OLITERAL, ir.ONIL, ir.ONAME, ir.OLINKSYMOFFSET, ir.OMETHEXPR,
ir.OAND, ir.OANDNOT, ir.OLSH, ir.OOR, ir.ORSH, ir.OXOR, ir.OCOMPLEX, ir.OEFACE,
- ir.OANDAND, ir.OOROR,
ir.OADDR, ir.OBITNOT, ir.ONOT, ir.OPLUS,
ir.OCAP, ir.OIMAG, ir.OLEN, ir.OREAL,
ir.OCONVNOP, ir.ODOT,