Find a file
Russ Cox 8ef4135731 [release-branch.go1.3] cmd/gc: two escape analysis fixes
««« CL 108860043 / f153208c0a0e
cmd/gc: fix escape analysis for &x inside switch x := v.(type)

The analysis for &x was using the loop depth on x set
during x's declaration. A type switch creates a list of
implicit declarations that were not getting initialized
with loop depths.

Fixes #8176.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/108860043
»»»

««« CL 108870044 / 331dbd4a6334
cmd/gc: fix &result escaping into result

There is a hierarchy of location defined by loop depth:

        -1 = the heap
        0 = function results
        1 = local variables (and parameters)
        2 = local variable declared inside a loop
        3 = local variable declared inside a loop inside a loop
        etc

In general if an address from loopdepth n is assigned to
something in loop depth m < n, that indicates an extended
lifetime of some form that requires a heap allocation.

Function results can be local variables too, though, and so
they don't actually fit into the hierarchy very well.
Treat the address of a function result as level 1 so that
if it is written back into a result, the address is treated
as escaping.

Fixes  issue 8185 .

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/108870044
»»»

LGTM=r
R=golang-codereviews, r
CC=bradfitz, golang-codereviews, iant
https://golang.org/cl/107930044
2014-06-11 17:00:17 -04:00
api api: add go1.3.txt 2014-06-02 11:45:00 +09:00
doc [release-branch.go1.3] docs: link to the assembler document from the Documents tab 2014-06-11 16:55:04 -04:00
include liblink: fix field tracking 2014-05-20 00:30:58 -04:00
lib lib/timezone: update to IANA 2014d 2014-06-01 00:15:23 +00:00
misc [release-branch.go1.3] nacltest.bash, misc/nacl/README: update NaCl docs. 2014-06-11 16:55:24 -04:00
src [release-branch.go1.3] cmd/gc: two escape analysis fixes 2014-06-11 17:00:17 -04:00
test [release-branch.go1.3] cmd/gc: two escape analysis fixes 2014-06-11 17:00:17 -04:00
.hgignore lib9: enable on Plan 9 2014-02-13 20:06:41 +01:00
.hgtags tag go1.3beta1 and go1.3beta2 2014-05-21 13:23:24 +10:00
AUTHORS A+C: Pietro Gagliardi (individual CLA) 2014-05-21 16:01:41 -07:00
CONTRIBUTORS C: add another email of mine. 2014-05-31 01:55:11 -07:00
favicon.ico godoc: update favicon 2012-10-11 17:02:36 +11:00
LICENSE
PATENTS
README README: Fix installation instructions 2013-11-20 13:47:37 -08:00
robots.txt
VERSION go1.3rc1 2014-06-02 14:34:50 +10:00

This is the source code repository for the Go programming language.  

For documentation about how to install and use Go,
visit http://golang.org/ or load doc/install-source.html
in your web browser.

After installing Go, you can view a nicely formatted
doc/install-source.html by running godoc --http=:6060
and then visiting http://localhost:6060/doc/install/source.

Unless otherwise noted, the Go source files are distributed
under the BSD-style license found in the LICENSE file.

--

Binary Distribution Notes

If you have just untarred a binary Go distribution, you need to set
the environment variable $GOROOT to the full path of the go
directory (the one containing this README).  You can omit the
variable if you unpack it into /usr/local/go, or if you rebuild
from sources by running all.bash (see doc/install.html).
You should also add the Go binary directory $GOROOT/bin
to your shell's path.

For example, if you extracted the tar file into $HOME/go, you might
put the following in your .profile:

    export GOROOT=$HOME/go
    export PATH=$PATH:$GOROOT/bin

See doc/install.html for more details.