From d0e92f61e5c5c59395d9b1a3b4f5c7b90dec5bc8 Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Mon, 3 Oct 2016 15:21:16 -0400 Subject: [PATCH] cmd/compile: remove unnecessary write barriers for APPEND Updates #17330. Change-Id: I83fe80139a2213f3169db884b84a4c3bd15b58b6 Reviewed-on: https://go-review.googlesource.com/30140 Run-TryBot: Cherry Zhang TryBot-Result: Gobot Gobot Reviewed-by: Keith Randall --- src/cmd/compile/internal/gc/ssa.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/gc/ssa.go b/src/cmd/compile/internal/gc/ssa.go index f5e1c5f0c7..419240eab7 100644 --- a/src/cmd/compile/internal/gc/ssa.go +++ b/src/cmd/compile/internal/gc/ssa.go @@ -667,7 +667,7 @@ func (s *state) stmt(n *Node) { r = s.expr(rhs) } } - if rhs != nil && rhs.Op == OAPPEND { + if rhs != nil && rhs.Op == OAPPEND && needwritebarrier(n.Left, rhs) { // The frontend gets rid of the write barrier to enable the special OAPPEND // handling above, but since this is not a special case, we need it. // TODO: just add a ptr graying to the end of growslice? -- 2.50.0