aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/gc/walk.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/gc/walk.go')
-rw-r--r--src/cmd/compile/internal/gc/walk.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/gc/walk.go b/src/cmd/compile/internal/gc/walk.go
index 8248d503b3..efe2016e46 100644
--- a/src/cmd/compile/internal/gc/walk.go
+++ b/src/cmd/compile/internal/gc/walk.go
@@ -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)