runtime: remove misleading message during crash
The following checkdead message is false positive:

$ go test -race -c runtime
$ ./runtime.test -test.cpu=2 -test.run=TestSmhasherWindowed -test.v
=== RUN TestSmhasherWindowed-2
checkdead: find g 18 in status 1
SIGABRT: abort
PC=0x42bff1

LGTM=rsc
R=golang-codereviews, gobot, rsc
CC=golang-codereviews, iant, khr
https://codereview.appspot.com/59490046
syscall: make use of include/linux when generating system constants

On Linux include/net directory is just to help porting applications
from BSDs and files under net keep less information than include/linux.
Making use of files under include/linux instead of include/net prevents
lack of information.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://codereview.appspot.com/63930043
net: handle IP interface stack correctly on linux

A configuration like the following:

7: tun6rd: <NOARP,UP,LOWER_UP> mtu 1280
        link/sit 10.11.12.13 brd 0.0.0.0
        inet 1.2.3.4/24 scope global tun6rd
        inet6 2014:1001:a0b:c0d::1/32 scope global
        inet6 ::10.11.12.13/128 scope global
9: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1496
        link/ppp
        inet 192.168.101.234 peer 192.168.102.234/32 scope global ppp0
        inet 10.20.30.40/24 scope global ppp0
        inet6 2014:1002::1/64 scope global
11: tun0@NONE: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1480
        link/ipip 192.168.202.34 peer 192.168.202.69
        inet 192.168.10.1/24 scope global tunnel0
        inet6 2014:1003::1/64 scope global

will be handled like below.

"tun6rd": flags "up", ifindex 7, mtu 1280
        hardware address ""
        interface address "1.2.3.4/24"
        interface address "2014:1001:a0b:c0d::1/32"
        interface address "::a0b:c0d/128"
"ppp0": flags "up|pointtopoint|multicast", ifindex 9, mtu 1496
        hardware address ""
        interface address "192.168.101.234/32"
        interface address "10.20.30.40/24"
        interface address "2014:1002::1/64"
"tun0": flags "up|pointtopoint", ifindex 11, mtu 1480
        hardware address ""
        interface address "192.168.10.1/24"
        interface address "2014:1003::1/64"

Fixes issue 6433.
Update issue 4839

LGTM=iant
R=iant
CC=golang-codereviews
https://codereview.appspot.com/57700043
runtime: if traceback sees a breakpoint, don't change the PC

Changing the PC confuses gdb, because execution does not
continue where gdb expects it.  Not changing the PC has the
potential to confuse a stack dump, but when running under gdb
it seems better to confuse a stack dump than to confuse gdb.

Fixes issue 6776.

LGTM=rsc
R=golang-codereviews, dvyukov, rsc
CC=golang-codereviews
https://codereview.appspot.com/49580044
cmd/go: remove cross compiling restriction on cgo

A previous CL added support for cross compiling with cgo, but
missed the GOOS check in cmd/go. Remove it.

Update issue 4714

LGTM=iant
R=iant
CC=golang-codereviews
https://codereview.appspot.com/57210046

Committer: Ian Lance Taylor <iant@golang.org>
math/big: Add text marshaller interface to Int

Fixes issue 7329

LGTM=gri
R=gri, bradfitz, mtj
CC=golang-codereviews
https://codereview.appspot.com/63710043

Committer: Robert Griesemer <gri@golang.org>
runtime: fix "invalid address in sys call" on Plan 9

Rfork is not splitting the stack when creating a new thread,
so the parent and child are executing on the same stack.
However, if the parent returns and keeps executing before
the child can read the arguments from the parent stack,
the child will not see the right arguments. The solution
is to load the needed pieces from the parent stack into
register before INT $64.

Thanks to Russ Cox for the explanation.

LGTM=rsc
R=rsc
CC=ality, golang-codereviews
https://codereview.appspot.com/64140043
compress/bzip2: support superfluous Huffman levels.

These should never be found in a bzip2 file but it does appear that
there's a buggy encoder that is producing them. Since the official
bzip2 handles this case, this change makes the Go code do likewise.

With this change, the code produces the same output as the official
bzip2 code on the invalid example given in the bug.

Fixes issue 7279.

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://codereview.appspot.com/64010043
codereview: fix for Mercurial 2.9

The branchtags method was removed but we should've
been using branchmap all along.

http://selenic.com/hg/rev/4274eda143cb

LGTM=franciscossouza, r
R=golang-codereviews, franciscossouza, r
CC=golang-codereviews
https://codereview.appspot.com/57500045
text/template: don't panic when function call evaluates a nil pointer
Catch the error instead and return it to the user. Before this fix,
the template package panicked. Now you get:
        template: bug11:1:14: executing "bug11" at <.PS>: dereference of nil pointer of type *string
Extended example at http://play.golang.org/p/uP6pCW3qKT

Fixes issue 7333.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://codereview.appspot.com/64150043
cmd/gc: do not lower copy to a value node in go/defer.

The existing tests issue4463.go and issue4654.go had failures at
typechecking and did not test walking the AST.

Fixes issue 7272.

LGTM=khr
R=khr, rsc, iant
CC=golang-codereviews
https://codereview.appspot.com/60550044
cmd/gc: correct liveness for fat variables

The VARDEF placement must be before the initialization
but after any final use. If you have something like s = ... using s ...
the rhs must be evaluated, then the VARDEF, then the lhs
assigned.

There is a large comment in pgen.c on gvardef explaining
this in more detail.

This CL also includes Ian's suggestions from earlier CLs,
namely commenting the use of mode in link.h and fixing
the precedence of the ~r check in dcl.c.

This CL enables the check that if liveness analysis decides
a variable is live on entry to the function, that variable must
be a function parameter (not a result, and not a local variable).
If this check fails, it indicates a bug in the liveness analysis or
in the generated code being analyzed.

The race detector generates invalid code for append(x, y...).
The code declares a temporary t and then uses cap(t) before
initializing t. The new liveness check catches this bug and
stops the compiler from writing out the buggy code.
Consequently, this CL disables the race detector tests in
run.bash until the race detector bug can be fixed
(golang.org/issue/7334).

Except for the race detector bug, the liveness analysis check
does not detect any problems (this CL and the previous CLs
fixed all the detected problems).

The net test still fails with GOGC=0 but the rest of the tests
now pass or time out (because GOGC=0 is so slow).

TBR=iant
CC=golang-codereviews
https://codereview.appspot.com/64170043
debug/elf: correct test failure print

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/64380043
cmd/gc: avoid pointer beyond array in range loop

This problem was discovered by reading the code.
I have not seen it in practice, nor do I have any ideas
on how to trigger it reliably in a test. But it's still worth
fixing.

TBR=ken2
CC=golang-codereviews
https://codereview.appspot.com/64370046
cmd/gc: record &x[0] as taking address of x, if x is an array

Not recording the address being taken was causing
the liveness analysis not to preserve x in the absence
of direct references to x, which in turn was making the
net test fail with GOGC=0.

In addition to the test, this fixes a bug wherein
        GOGC=0 go test -short net
crashed if liveness analysis was in use (like at tip, not like Go 1.2).

TBR=ken2
CC=golang-codereviews
https://codereview.appspot.com/64470043
build: disable race detector test in run.bat on windows

CL 64170043 disabled it in run.bash for Unix systems.
I did not realize Windows systems also ran the race detector test.

TBR=iant
CC=golang-codereviews
https://codereview.appspot.com/64480043
go/build: temporarily disable cgo for freebsd/arm

Update issue 7331

cgo is currently broken on freebsd/arm.

LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://codereview.appspot.com/63900043
net/http: close body in benchmarks
Is it required? Why don't we do it?

R=bradfitz
CC=golang-codereviews
https://codereview.appspot.com/61150043
testing: ease writing parallel benchmarks
Add b.RunParallel function that captures parallel benchmark boilerplate:
creates worker goroutines, joins worker goroutines, distributes work
among them in an efficient way, auto-tunes grain size.
Fixes issue 7090.

R=bradfitz, iant, josharian, tracey.brendan, r, rsc, gobot
CC=golang-codereviews
https://codereview.appspot.com/57270043
cmd/gc: correct function name in internal error messages

LGTM=r
R=golang-codereviews, r
CC=golang-codereviews
https://codereview.appspot.com/64090043