Commit 75d367e3 authored by Matthew Dempsky's avatar Matthew Dempsky

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: default avatarKeith Randall <khr@golang.org>
parent 12979345
......@@ -694,6 +694,10 @@ opswitch:
break
}
if !instrumenting && iszero(n.Right) && !needwritebarrier(n.Left, n.Right) {
break
}
switch n.Right.Op {
default:
n.Right = walkexpr(n.Right, init)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment