os: handle 'no parent' error as IsNotExist on Plan 9

This error is returned by lib9p when removing a file
without parent. It should fix TestRemoveAllRace
when running on ramfs.

LGTM=bradfitz, aram
R=rsc, bradfitz, aram
CC=golang-codereviews, mischief
https://codereview.appspot.com/153410044
test: add test for gccgo-specific issue 8079

LGTM=gri
R=gri
CC=golang-codereviews, iant
https://codereview.appspot.com/159850044
math/big: Fixes issue 8920

(*Rat).SetString checks for denominator.

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

Committer: Robert Griesemer <gri@golang.org>
crypto/x509: continue to recognise MaxPathLen of zero as "no value".

In [1] the behaviour of encoding/asn1 with respect to marshaling
optional integers was changed. Previously, a zero valued integer would
be omitted when marshaling. After the change, if a default value was
set then the integer would only be omitted if it was the default value.

This changed the behaviour of crypto/x509 because
Certificate.MaxPathLen has a default value of -1 and thus zero valued
MaxPathLens would no longer be omitted when marshaling. This is
arguably a bug-fix -- a value of zero for MaxPathLen is valid and
meaningful and now could be expressed. However it broke users
(including Docker) who were not setting MaxPathLen at all.

This change again causes a zero-valued MaxPathLen to be omitted and
introduces a ZeroMathPathLen member that indicates that, yes, one
really does want a zero. This is ugly, but we value not breaking users.

[1] https://code.google.com/p/go/source/detail?r=4218b3544610e8d9771b89126553177e32687adf

LGTM=rsc
R=rsc
CC=golang-codereviews, golang-dev
https://codereview.appspot.com/153420045
runtime: a few optimizations of scanblock.

Lowers gc pause time by 5-10% on test/bench/garbage

LGTM=rsc, dvyukov
R=rsc, dvyukov
CC=golang-codereviews
https://codereview.appspot.com/157810043
cmd/gc: fix 'make' in cmd/gc directory

Right now, go tool 6g -A fails complaining about 'any' type.

TBR=r
CC=golang-codereviews
https://codereview.appspot.com/156200044
cmd/gc: add 2-, 3-, 4-word write barrier specializations

Assignments of 2-, 3-, and 4-word values were handled
by individual MOV instructions (and for scalars still are).
But if there are pointers involved, those assignments now
go through the write barrier routine. Before this CL, they
went to writebarrierfat, which calls memmove.
Memmove is too much overhead for these small
amounts of data.

Instead, call writebarrierfat{2,3,4}, which are specialized
for the specific amount of data being copied.
Today the write barrier does not care which words are
pointers, so size alone is enough to distinguish the cases.
If we keep these distinctions in Go 1.5 we will need to
expand them for all the pointer-vs-scalar possibilities,
so the current 3 functions will become 3+7+15 = 25,
still not a large burden (we deleted more morestack
functions than that when we dropped segmented stacks).

BenchmarkBinaryTree17           3250972583  3123910344  -3.91%
BenchmarkFannkuch11             3067605223  2964737839  -3.35%
BenchmarkFmtFprintfEmpty        101         96.0        -4.95%
BenchmarkFmtFprintfString       267         235         -11.99%
BenchmarkFmtFprintfInt          261         253         -3.07%
BenchmarkFmtFprintfIntInt       444         402         -9.46%
BenchmarkFmtFprintfPrefixedInt  374         346         -7.49%
BenchmarkFmtFprintfFloat        472         449         -4.87%
BenchmarkFmtManyArgs            1537        1476        -3.97%
BenchmarkGobDecode              13986528    12432985    -11.11%
BenchmarkGobEncode              13120323    12537420    -4.44%
BenchmarkGzip                   451925758   437500578   -3.19%
BenchmarkGunzip                 113267612   110053644   -2.84%
BenchmarkHTTPClientServer       103151      77100       -25.26%
BenchmarkJSONEncode             25002733    23435278    -6.27%
BenchmarkJSONDecode             94213717    82568789    -12.36%
BenchmarkMandelbrot200          4804246     4713070     -1.90%
BenchmarkGoParse                4646114     4379456     -5.74%
BenchmarkRegexpMatchEasy0_32    163         158         -3.07%
BenchmarkRegexpMatchEasy0_1K    433         391         -9.70%
BenchmarkRegexpMatchEasy1_32    154         138         -10.39%
BenchmarkRegexpMatchEasy1_1K    1481        1132        -23.57%
BenchmarkRegexpMatchMedium_32   282         270         -4.26%
BenchmarkRegexpMatchMedium_1K   92421       86149       -6.79%
BenchmarkRegexpMatchHard_32     5209        4718        -9.43%
BenchmarkRegexpMatchHard_1K     158141      147921      -6.46%
BenchmarkRevcomp                699818791   642222464   -8.23%
BenchmarkTemplate               132402383   108269713   -18.23%
BenchmarkTimeParse              509         478         -6.09%
BenchmarkTimeFormat             462         456         -1.30%

LGTM=r
R=r
CC=golang-codereviews
https://codereview.appspot.com/156200043
math/big: Allow non-prime modulus for ModInverse

The inverse is defined whenever the element and the
modulus are relatively prime.  The code already handles
this situation, but the spec does not.

Test that it does indeed work.

Fixes issue 8875

LGTM=agl
R=agl
CC=golang-codereviews
https://codereview.appspot.com/155010043
runtime: handle all windows exception (second attempt)

includes undo of 22318cd31d7d and also:
- always use SetUnhandledExceptionFilter on windows-386;
- crash when receive EXCEPTION_BREAKPOINT in exception handler.

Fixes issue 8006.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://codereview.appspot.com/155360043
cmd/gc: check for initialization cycles in method values

Fixes issue 7960.

LGTM=rsc
R=rsc
CC=golang-codereviews, gri
https://codereview.appspot.com/159800045
encoding/gob: make encoding structs a little faster
FieldByIndex never returns an invalid Value, so the validity
test can be avoided if the field is not indirect.

BenchmarkGobEncode     12768642      12424022      -2.70%
BenchmarkGobEncode     60.11        61.78        1.03x

LGTM=rsc
R=rsc
CC=golang-codereviews
https://codereview.appspot.com/158890045
cmd/gc, runtime: fix race, nacl for writebarrier changes

The racewalk code was not updated for the new write barriers.
Make it more future-proof.

The new write barrier code assumed that +1 pointer would
be aligned properly for any type that might follow, but that's
not true on 32-bit systems where some types are 64-bit aligned.
The only system like that today is nacl/amd64p32.
Insert a dummy pointer so that the ambiguously typed
value is at +2 pointers, which is always max-aligned.

LGTM=r
R=r
CC=golang-codereviews, iant, khr
https://codereview.appspot.com/158890046
go/build: Return MultiplePackageError on importing a dir containing multiple packages

When the Import function in go/build encounters a directory
without any buildable Go source files, it returns a handy
NoGoError. Now if, instead it encounters multiple Go source files
from multiple packages, it returns a handy MultiplePackageError.

A new test for NoGoError and MultiplePackageError is also provided.

Fixes issue 8286.

LGTM=adg, rsc
R=bradfitz, rsc, adg
CC=golang-codereviews
https://codereview.appspot.com/155050043

Committer: Russ Cox <rsc@golang.org>
liblink: require DATA lines to be ordered by offset, with no overlap

The assembler could give a better error, but this one
is good enough for now.

Fixes issue 8880.

LGTM=r
R=r
CC=golang-codereviews
https://codereview.appspot.com/153610043
crypto/x509: correct field name in comment

Fixes issue 8936.

LGTM=bradfitz
R=agl, bradfitz
CC=golang-codereviews
https://codereview.appspot.com/152590043
net/http: don't reuse a server connection after any Write errors

Fixes Issue 8534

LGTM=adg
R=adg
CC=golang-codereviews
https://codereview.appspot.com/149340044
net/http: don't send implicit gzip Accept-Encoding on Range requests

The http package by default adds "Accept-Encoding: gzip" to outgoing
requests, unless it's a bad idea, or the user requested otherwise.
Only when the http package adds its own implicit Accept-Encoding header
does the http package also transparently un-gzip the response.

If the user requested part of a document (e.g. bytes 40 to 50), it appears
that Github/Varnish send:
        range(gzip(content), 40, 50)

And not:
        gzip(range(content, 40, 50))

The RFC 2616 set of replacements (with the purpose of
clarifying ambiguities since 1999) has an RFC about Range
requests (http://tools.ietf.org/html/rfc7233) but does not
mention the interaction with encodings.

Regardless of whether range(gzip(content)) or gzip(range(content)) is
correct, this change prevents the Go package from asking for gzip
in requests if we're also asking for Range, avoiding the issue.
If the user cared, they can do it themselves. But Go transparently
un-gzipping a fragment of gzip is never useful.

Fixes Issue 8923

LGTM=adg
R=adg
CC=golang-codereviews
https://codereview.appspot.com/155420044
cmd/gc: blank methods are not permitted in interface types

Fixes issue 6606.

LGTM=rsc
R=rsc
CC=golang-codereviews, gri
https://codereview.appspot.com/156210044
os/exec: document that Stdin goroutine must finish in Wait

Fixes issue 7990.

LGTM=iant, bradfitz
R=bradfitz, iant, robryk
CC=golang-codereviews
https://codereview.appspot.com/156220043
database/sql: add Drivers, returning list of registered drivers

Fixes issue 7969.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://codereview.appspot.com/158950043