From: Keith Randall Date: Wed, 7 Sep 2016 04:08:21 +0000 (-0700) Subject: cmd/compile: ignore contentEscapes for marking nodes as escaping X-Git-Tag: go1.8beta1~1461 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=83c73a85db84a04c8e60e52cfa348fc6b675fbf7;p=gostls13.git cmd/compile: ignore contentEscapes for marking nodes as escaping Redo of CL 28575 with fixed test. We're in a pre-KeepAlive world for a bit yet, the old tests were in a client which was in a post-KeepAlive world. Change-Id: I114fd630339d761ab3306d1d99718d3cb973678d Reviewed-on: https://go-review.googlesource.com/28582 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- diff --git a/src/cmd/compile/internal/gc/esc.go b/src/cmd/compile/internal/gc/esc.go index c5597d7f48..0fd514fbaf 100644 --- a/src/cmd/compile/internal/gc/esc.go +++ b/src/cmd/compile/internal/gc/esc.go @@ -1572,7 +1572,7 @@ func esccall(e *EscState, n *Node, up *Node) { } if haspointers(t.Type) { - if escassignfromtag(e, note, nE.Escretval, src) == EscNone && up.Op != ODEFER && up.Op != OPROC { + if escassignfromtag(e, note, nE.Escretval, src)&EscMask == EscNone && up.Op != ODEFER && up.Op != OPROC { a := src for a.Op == OCONVNOP { a = a.Left diff --git a/test/live.go b/test/live.go index db47e14e93..c3985a37a2 100644 --- a/test/live.go +++ b/test/live.go @@ -643,3 +643,14 @@ 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: x y autotmp_[0-9]+$" + printnl() // ERROR "live at call to printnl: x y$" + // Note: no autotmp live at printnl. See issue 16996. +} +func ddd2(a ...*int) { // ERROR "live at entry to ddd2: a$" + sink = a[0] +} + +var sink *int diff --git a/test/live_ssa.go b/test/live_ssa.go index 27c4528dc1..41ac407db3 100644 --- a/test/live_ssa.go +++ b/test/live_ssa.go @@ -646,3 +646,12 @@ 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: x y autotmp_[0-9]+$" + printnl() // ERROR "live at call to printnl: x y$" + // Note: no autotmp live at printnl. See issue 16996. +} +func ddd2(a ...*int) { // ERROR "live at entry to ddd2: a$" + sink = a[0] +}