]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: restore constant folding optimization within OADDSTR
authorMatthew Dempsky <mdempsky@google.com>
Thu, 28 Feb 2019 02:27:13 +0000 (18:27 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 13 Mar 2019 18:24:16 +0000 (18:24 +0000)
Change-Id: Ib55f2458c75aee49302f0dd4e2a819f9931a5ed3
Reviewed-on: https://go-review.googlesource.com/c/go/+/166982
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/const.go

index 18f8d352e91b101a45da8a0da2b3960929c3111e..825f08ca8ab0893866e9a0399b7098b469b27c34 100644 (file)
@@ -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, "")})