cmd/5g: use MOVB for fixed array nil check

Fixes issue 4396.

For fixed arrays larger than the unmapped page, agenr would general a nil check by loading the first word of the array. However there is no requirement for the first element of a byte array to be word aligned, so this check causes a trap on ARMv5 hardware (ARMv6 since relaxed that restriction, but it probably still comes at a cost).

Switching the check to MOVB ensures alignment is not an issue. This check is only invoked in a few places in the code where large fixed arrays are embedded into structs, compress/lzw is the biggest offender, and switching to MOVB has no observable performance penalty.

Thanks to Rémy and Daniel Morsing for helping me debug this on IRC last night.

R=remyoudompheng, minux.ma, rsc
CC=golang-dev
https://codereview.appspot.com/6854063
gc: avoid meaningless constant overflow error for inverted slice range

Used to say:

issue4251.go:12: inverted slice range
issue4251.go:12: constant -1 overflows uint64
issue4251.go:16: inverted slice range
issue4251.go:16: constant -1 overflows uint64
issue4251.go:20: inverted slice range
issue4251.go:20: constant -1 overflows uint64

With this patch, only gives the "inverted slice range" errors.

R=golang-dev, daniel.morsing
CC=golang-dev
https://codereview.appspot.com/6871058
net/http: fix bug parsing http_proxy lacking a protocol

Per the curl man page, the http_proxy configuration can be
of the form:

   [protocol://]<host>[:port]

And we had a test that <ip>:<port> worked, but if
the host began with a letter, url.Parse parsed the hostname
as the scheme instead, confusing ProxyFromEnvironment.

R=golang-dev
CC=golang-dev
https://codereview.appspot.com/6875060
net/http: implement CloseNotifier

Fixes issue 2510

R=golang-dev, rsc
CC=golang-dev
https://codereview.appspot.com/6867050
vet: be less strict about number of arguments when a ... is present.

R=golang-dev
CC=golang-dev
https://codereview.appspot.com/6883046
net: document that File reverts connection to blocking mode.

Fixes issue 2458.

R=mikioh.mikioh, rsc
CC=golang-dev
https://codereview.appspot.com/6869054

Committer: Russ Cox <rsc@golang.org>
test: add some tests where go/defer arg starts with parenthesis

R=gri
CC=golang-dev
https://codereview.appspot.com/6890047
cmd/ld: skip 0-length write in cwrite

The 0-length part is fine, but some callers that write 0 bytes
also pass nil as the data pointer, and the Plan 9 kernel kills the
process with 'invalid address in sys call' in that case.

R=ken2
CC=golang-dev
https://codereview.appspot.com/6862051
cmd/5g: fix fixedtests/issue4396b.go test failure on arm5

Add missing file that should have been included in CL 6854063 / 5eac1a2d6fc3

R=remyoudompheng, minux.ma, rsc
CC=golang-dev
https://codereview.appspot.com/6891049
cmd/6c, cmd/8c: add fixjmp step to regopt.

The fixjmp step eliminates redundant chains of JMP
instructions that are produced by the compiler during
code generation.

It is already implemented in gc, and can be adapted to 6c/8c with
the exception that JMPs refer to destination by pc instead of by
pointer. The algorithm is modified to operate on Regs instead of Progs
for this reason. The pcs are already restored later by regopt.

R=goalng-dev, rsc
CC=golang-dev
https://codereview.appspot.com/6865046
cmd/8a: support XMM registers.

R=rsc, golang-dev
CC=golang-dev
https://codereview.appspot.com/6884046
net/http: populate ContentLength in HEAD responses

Also fixes a necessary TODO in the process.

Fixes issue 4126

R=golang-dev, rsc
CC=golang-dev
https://codereview.appspot.com/6869053
cmd/gc: do not overflow parser stack on a long chain of else if.

Fixes issue 2615.

R=dave, minux.ma, iant, daniel.morsing, rsc
CC=golang-dev
https://codereview.appspot.com/6847078
spec: type assertions and type switches must be valid

The spec didn't preclude invalid type assertions and
type switches, i.e., cases where a concrete type doesn't
implement the interface type in the assertion in the first
place. Both, the gc and gccgo compiler exclude these cases.
This is documenting the status quo.

Also:
- minor clean up of respective examples
- added sentence about default case in select statements

Fixes issue 4472.

R=rsc, iant, r, ken
CC=golang-dev
https://codereview.appspot.com/6869050
gofmt: test rewrite of (x.(type)) -> x.(type)

R=rsc
CC=golang-dev
https://codereview.appspot.com/6867062
exp/types: checking of type switches and range clauses

Also:
- better handling of type assertions
- implemented built-in error type
- first cut at handling variadic function signatures
- several bug fixes

R=rsc, rogpeppe
CC=golang-dev
https://codereview.appspot.com/6846131
exp/gotype: added many more tests

gotype can now handle much of the standard library.

- marked packages which have type checker issues
- this CL depends on CL 6846131

R=rsc
CC=golang-dev
https://codereview.appspot.com/6850130
spec: receiver types in method expressions can be parenthesized

Fixes issue 4457.

R=rsc, iant, r, ken
CC=golang-dev
https://codereview.appspot.com/6862046
fix build: remove a flaky test for now

R=rsc
CC=golang-dev
https://codereview.appspot.com/6889052