misc/cgo/test: changes to pass when using gccgo

R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/6821067
exp/types, exp/gotype: remove exp/types

The only code change is in exp/gotype/gotype.go.
The latest reviewed version of exp/types is now
exp/types/staging.

First step toward replacing exp/types with
exp/types/staging.

R=iant
CC=golang-dev
http://codereview.appspot.com/6819071
exp/types: move exp/types/staging -> exp/types

- removes exp/types/staging
- the only code change is in exp/gotype/gotype.go

R=iant
CC=golang-dev
http://codereview.appspot.com/6822068
go/ast: document use of Data field for method objects

R=iant
CC=golang-dev
http://codereview.appspot.com/6775093
net: use better error messages on windows

Fixes issue 4320.

R=golang-dev, rsc
CC=golang-dev
http://codereview.appspot.com/6810064
cmd/gc, cmd/ld: struct field tracking

This is an experiment in static analysis of Go programs
to understand which struct fields a program might use.
It is not part of the Go language specification, it must
be enabled explicitly when building the toolchain,
and it may be removed at any time.

After building the toolchain with GOEXPERIMENT=fieldtrack,
a specific field can be marked for tracking by including
`go:"track"` in the field tag:

        package pkg

        type T struct {
                F int `go:"track"`
                G int // untracked
        }

To simplify usage, only named struct types can have
tracked fields, and only exported fields can be tracked.

The implementation works by making each function begin
with a sequence of no-op USEFIELD instructions declaring
which tracked fields are accessed by a specific function.
After the linker's dead code elimination removes unused
functions, the fields referred to by the remaining
USEFIELD instructions are the ones reported as used by
the binary.

The -k option to the linker specifies the fully qualified
symbol name (such as my/pkg.list) of a string variable that
should be initialized with the field tracking information
for the program. The field tracking string is a sequence
of lines, each terminated by a \n and describing a single
tracked field referred to by the program. Each line is made
up of one or more tab-separated fields. The first field is
the name of the tracked field, fully qualified, as in
"my/pkg.T.F". Subsequent fields give a shortest path of
reverse references from that field to a global variable or
function, corresponding to one way in which the program
might reach that field.

A common source of false positives in field tracking is
types with large method sets, because a reference to the
type descriptor carries with it references to all methods.
To address this problem, the CL also introduces a comment
annotation

        //go:nointerface

that marks an upcoming method declaration as unavailable
for use in satisfying interfaces, both statically and
dynamically. Such a method is also invisible to package
reflect.

Again, all of this is disabled by default. It only turns on
if you have GOEXPERIMENT=fieldtrack set during make.bash.

R=iant, ken
CC=golang-dev
http://codereview.appspot.com/6749064
spec: we're now at Unicode 6.2.0

R=golang-dev
CC=golang-dev
http://codereview.appspot.com/6818083

Committer: Rob Pike <r@golang.org>
image/png: update palette out-of-bounds comment.

R=r
CC=golang-dev
http://codereview.appspot.com/6817070
cmd/5g, cmd/6g: fix out of registers with array indexing.

Compiling expressions like:
    s[s[s[s[s[s[s[s[s[s[s[s[i]]]]]]]]]]]]
make 5g and 6g run out of registers. Such expressions can arise
if a slice is used to represent a permutation and the user wants
to iterate it.

This is due to the usual problem of allocating registers before
going down the expression tree, instead of allocating them in a
postfix way.

The functions cgenr and agenr (that generate a value to a newly
allocated register instead of an existing location), are either
introduced or modified when they already existed to allocate
the new register as late as possible, and sudoaddable is disabled
for OINDEX nodes so that igen/agenr is used instead.

Update issue 4207.

R=dave, daniel.morsing, rsc
CC=golang-dev
http://codereview.appspot.com/6733055
net: add missing locking in windows Shutdown

R=golang-dev, bradfitz
CC=golang-dev
http://codereview.appspot.com/6811069
misc/benchcmp: show memory statistics, when available

R=minux.ma, dave, extraterrestrial.neighbour, rsc
CC=golang-dev
http://codereview.appspot.com/6587069

Committer: Shenghou Ma <minux.ma@gmail.com>
runtime/cgo, go/build: cgo support for FreeBSD/ARM
This is the last CL for FreeBSD/ARM support.
Also update cmd/ld/doc.go for 5l support of -Hfreebsd.

R=rsc
CC=golang-dev
http://codereview.appspot.com/6650051