]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/gc: simplify `x = x <op> y` to `x <op>= y`
authorIskander Sharipov <quasilyte@gmail.com>
Mon, 17 Sep 2018 22:04:41 +0000 (01:04 +0300)
committerRobert Griesemer <gri@golang.org>
Wed, 19 Sep 2018 02:56:21 +0000 (02:56 +0000)
Change-Id: I5afba2c10372252be4b65dae7a95461722de904f
Reviewed-on: https://go-review.googlesource.com/135835
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/compile/internal/gc/esc.go
src/cmd/compile/internal/gc/walk.go

index cd85a38eb6c42bb04f4aa0d87702823b7371c658..ad4d11806c84d360f939af69989a0c2bd87bfa8b 100644 (file)
@@ -1419,7 +1419,7 @@ func describeEscape(em uint16) string {
                }
                s += "contentToHeap"
        }
-       for em >>= EscReturnBits; em != 0; em = em >> bitsPerOutputInTag {
+       for em >>= EscReturnBits; em != 0; em >>= bitsPerOutputInTag {
                // See encoding description above
                if s != "" {
                        s += " "
@@ -1469,7 +1469,7 @@ func (e *EscState) escassignfromtag(note string, dsts Nodes, src, call *Node) ui
 
        em0 := em
        dstsi := 0
-       for em >>= EscReturnBits; em != 0 && dstsi < dsts.Len(); em = em >> bitsPerOutputInTag {
+       for em >>= EscReturnBits; em != 0 && dstsi < dsts.Len(); em >>= bitsPerOutputInTag {
                // Prefer the lowest-level path to the reference (for escape purposes).
                // Two-bit encoding (for example. 1, 3, and 4 bits are other options)
                //  01 = 0-level
index 2c0bc4b22e74e9a87c75d5ceec930f5ec2bdeed4..0b382bbbf047e7d306cd82a70fe327e2140282ad 100644 (file)
@@ -1312,7 +1312,7 @@ opswitch:
                                                b = conv(b, convType)
                                                b = nod(OLSH, b, nodintconst(int64(8*offset)))
                                                ncsubstr = nod(OOR, ncsubstr, b)
-                                               csubstr = csubstr | int64(s[i+offset])<<uint8(8*offset)
+                                               csubstr |= int64(s[i+offset]) << uint8(8*offset)
                                        }
                                        csubstrPart := nodintconst(csubstr)
                                        // Compare "step" bytes as once