diff options
author | Than McIntosh <thanm@google.com> | 2016-07-14 13:23:11 -0400 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2016-10-03 18:07:32 +0000 |
commit | 6c5e377d23136bd371d205e1c2aae6ddccb4597e (patch) | |
tree | 955fc73c8ae2b8a636f632d88db3c2930753b0f9 /test/live.go | |
parent | 5f36e9a3062c1f133169d01d612da9458a7ea884 (diff) | |
download | go-6c5e377d23136bd371d205e1c2aae6ddccb4597e.tar.gz go-6c5e377d23136bd371d205e1c2aae6ddccb4597e.zip |
cmd/compile: relax liveness restrictions on ambiguously live
Update gc liveness to remove special conservative treatment
of ambiguously live vars, since there is no longer a need to
protect against GCDEBUG=gcdead.
Change-Id: Id6e2d03218f7d67911e8436d283005a124e6957f
Reviewed-on: https://go-review.googlesource.com/24896
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'test/live.go')
-rw-r--r-- | test/live.go | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/test/live.go b/test/live.go index b4d569a1ba..74548231dd 100644 --- a/test/live.go +++ b/test/live.go @@ -47,24 +47,25 @@ func f2(b bool) { } func f3(b1, b2 bool) { - // Because x and y are ambiguously live, they appear - // live throughout the function, to avoid being poisoned - // in GODEBUG=gcdead=1 mode. + // Here x and y are ambiguously live. In previous go versions they + // were marked as live throughout the function to avoid being + // poisoned in GODEBUG=gcdead=1 mode; this is now no longer the + // case. - printint(0) // ERROR "live at call to printint: x y$" + printint(0) if b1 == false { - printint(0) // ERROR "live at call to printint: x y$" + printint(0) return } if b2 { var x *int - printpointer(&x) // ERROR "live at call to printpointer: x y$" - printpointer(&x) // ERROR "live at call to printpointer: x y$" + printpointer(&x) // ERROR "live at call to printpointer: x$" + printpointer(&x) // ERROR "live at call to printpointer: x$" } else { var y *int - printpointer(&y) // ERROR "live at call to printpointer: x y$" - printpointer(&y) // ERROR "live at call to printpointer: x y$" + printpointer(&y) // ERROR "live at call to printpointer: y$" + printpointer(&y) // ERROR "live at call to printpointer: y$" } printint(0) // ERROR "f3: x \(type \*int\) is ambiguously live$" "f3: y \(type \*int\) is ambiguously live$" "live at call to printint: x y$" } |