mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: restore zero assignment optimization for non-pointer types
golang.org/cl/31572 disabled some write barrier optimizations, but inadvertantly disabled optimizations for some non-pointer composite literal assignments too. Fixes #18370. Change-Id: Ia25019bd3016b6ab58173298c7d16202676bce6b Reviewed-on: https://go-review.googlesource.com/34564 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
parent
12979345b1
commit
75d367e34b
1 changed files with 4 additions and 0 deletions
|
|
@ -694,6 +694,10 @@ opswitch:
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !instrumenting && iszero(n.Right) && !needwritebarrier(n.Left, n.Right) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
switch n.Right.Op {
|
switch n.Right.Op {
|
||||||
default:
|
default:
|
||||||
n.Right = walkexpr(n.Right, init)
|
n.Right = walkexpr(n.Right, init)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue