From: Matthew Dempsky Date: Thu, 28 Feb 2019 02:27:13 +0000 (-0800) Subject: cmd/compile: restore constant folding optimization within OADDSTR X-Git-Tag: go1.13beta1~1056 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0a04c0430e9671bd531a2928a8416424da1e3dde;p=gostls13.git cmd/compile: restore constant folding optimization within OADDSTR Change-Id: Ib55f2458c75aee49302f0dd4e2a819f9931a5ed3 Reviewed-on: https://go-review.googlesource.com/c/go/+/166982 Run-TryBot: Matthew Dempsky TryBot-Result: Gobot Gobot Reviewed-by: Robert Griesemer --- diff --git a/src/cmd/compile/internal/gc/const.go b/src/cmd/compile/internal/gc/const.go index 18f8d352e9..825f08ca8a 100644 --- a/src/cmd/compile/internal/gc/const.go +++ b/src/cmd/compile/internal/gc/const.go @@ -643,17 +643,6 @@ func evconst(n *Node) { i2++ } - // Hack to appease toolstash. Because - // we were checking isGoConst early - // on, we wouldn't collapse adjacent - // string constants unless the entire - // string was a constant. - // - // TODO(mdempsky): Remove in next commit. - if i1 != 0 || i2 != len(s) { - return - } - nl := *s[i1] nl.Orig = &nl nl.SetVal(Val{strings.Join(strs, "")})