]> Cypherpunks repositories - gostls13.git/commitdiff
Revert of cmd/compile: ignore contentEscapes for marking nodes as escaping
authorBrad Fitzpatrick <bradfitz@golang.org>
Wed, 7 Sep 2016 03:23:20 +0000 (03:23 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 7 Sep 2016 03:23:44 +0000 (03:23 +0000)
Reason for revert: broke the build due to cherrypick;
relies on an unsubmitted parent CL.

Original issue's description:
> cmd/compile: ignore contentEscapes for marking nodes as escaping
>
> We can still stack allocate and VarKill nodes which don't
> escape but their content does.
>
> Fixes #16996
>
> Change-Id: If8aa0fcf2c327b4cb880a3d5af8d213289e6f6bf
> Reviewed-on: https://go-review.googlesource.com/28575
> Run-TryBot: Keith Randall <khr@golang.org>
> TryBot-Result: Gobot Gobot <gobot@golang.org>
> Reviewed-by: David Chase <drchase@google.com>
>

Change-Id: Ie1a325209de14d70af6acb2d78269b7a0450da7a
Reviewed-on: https://go-review.googlesource.com/28578
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/gc/esc.go
test/live.go
test/live_ssa.go

index 0fd514fbaf49e5d1c0219a8afd42f521ba9befd5..c5597d7f487ebefb61587f289bb87683e9b5d249 100644 (file)
@@ -1572,7 +1572,7 @@ func esccall(e *EscState, n *Node, up *Node) {
                }
 
                if haspointers(t.Type) {
-                       if escassignfromtag(e, note, nE.Escretval, src)&EscMask == EscNone && up.Op != ODEFER && up.Op != OPROC {
+                       if escassignfromtag(e, note, nE.Escretval, src) == EscNone && up.Op != ODEFER && up.Op != OPROC {
                                a := src
                                for a.Op == OCONVNOP {
                                        a = a.Left
index ef0ade23c71d27615bd4b185834603a13539aad6..db47e14e93c2a4d8cd5e6940b347c9f32e484e76 100644 (file)
@@ -643,13 +643,3 @@ func good40() {
        printnl() // ERROR "live at call to printnl: autotmp_[0-9]+ ret$"
        _ = t
 }
-
-func ddd1(x, y *int) { // ERROR "live at entry to ddd1: x y$"
-       ddd2(x, y) // ERROR "live at call to ddd2: autotmp_[0-9]+$"
-       printnl()  // nothing live here.  See issue 16996.
-}
-func ddd2(a ...*int) { // ERROR "live at entry to ddd2: a$"
-       sink = a[0]
-}
-
-var sink *int
index cf06141b44f4f741beb09b7c7e8adc32fde1e1b9..27c4528dc1b022c81c3eeeae4ea4518bacc804ab 100644 (file)
@@ -646,11 +646,3 @@ func good40() {
        printnl() // ERROR "live at call to printnl: autotmp_[0-9]+ ret$"
        _ = t
 }
-
-func ddd1(x, y *int) { // ERROR "live at entry to ddd1: x y$"
-       ddd2(x, y) // ERROR "live at call to ddd2: autotmp_[0-9]+$"
-       printnl()  // nothing live here.  See issue 16996.
-}
-func ddd2(a ...*int) { // ERROR "live at entry to ddd2: a$"
-       sink = a[0]
-}