]> Cypherpunks repositories - gostls13.git/log
gostls13.git
9 years ago[dev.ssa] cmd/compile: make REPSTOSQ clobber flags
Todd Neal [Tue, 1 Sep 2015 22:56:37 +0000 (17:56 -0500)]
[dev.ssa] cmd/compile: make REPSTOSQ clobber flags

It does a XOR internally and clobbers flags.

Change-Id: Id6ef9219c4e6c3a2b5fc79c8d52bcfa30c148617
Reviewed-on: https://go-review.googlesource.com/14165
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: make SETEQF and SETNEF clobber flags
Keith Randall [Tue, 1 Sep 2015 22:18:01 +0000 (15:18 -0700)]
[dev.ssa] cmd/compile/internal/ssa: make SETEQF and SETNEF clobber flags

They do an AND or an OR internally, so they clobber flags.

Fixes #12441

Change-Id: I6c843bd268496bc13fc7e3c561d76619e961e8ad
Reviewed-on: https://go-review.googlesource.com/14180
Reviewed-by: Todd Neal <todd@tneal.org>
9 years ago[dev.ssa] cmd/compile: fix rare issue caused by liblink rewrite
Todd Neal [Sat, 29 Aug 2015 20:41:57 +0000 (15:41 -0500)]
[dev.ssa] cmd/compile: fix rare issue caused by liblink rewrite

liblink rewrites MOV $0, reg into XOR reg, reg. Make MOVxconst clobber
flags so we don't generate invalid code in the unlikely case that it
matters.  In testing, this change leads to no additional regenerated
flags due to a scheduling fix in CL14042.

Change-Id: I7bc1cfee94ef83beb2f97c31ec6a97e19872fb89
Reviewed-on: https://go-review.googlesource.com/14043
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: add complex arithmetic
David Chase [Fri, 28 Aug 2015 18:24:10 +0000 (14:24 -0400)]
[dev.ssa] cmd/compile: add complex arithmetic

Still to do:
details, more testing corner cases. (e.g. negative zero)
Includes small cleanups for previous CL.

Note: complex division is currently done in the runtime,
so the division code here is apparently not yet necessary
and also not tested.  Seems likely better to open code
division and expose the widening/narrowing to optimization.

Complex64 multiplication and division is done in wide
format to avoid cancellation errors; for division, this
also happens to be compatible with pre-SSA practice
(which uses a single complex128 division function).

It would-be-nice to widen for complex128 multiplication
intermediates as well, but that is trickier to implement
without a handy wider-precision format.

Change-Id: I595a4300f68868fb7641852a54674c6b2b78855e
Reviewed-on: https://go-review.googlesource.com/14028
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: allow ops to have a default type
Keith Randall [Tue, 1 Sep 2015 16:16:58 +0000 (09:16 -0700)]
[dev.ssa] cmd/compile/internal/ssa: allow ops to have a default type

Specifying types in rewrites for all subexpressions gets verbose
quickly.  Allow opcodes to specify a default type which is used when
none is supplied explicitly.

Provide default types for a few easy opcodes.  There are probably more
we can do, but this is a good start.

Change-Id: Iedc2a1a423cc3e2d4472640433982f9aa76a9f18
Reviewed-on: https://go-review.googlesource.com/14128
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: add more specific regalloc logging
Todd Neal [Tue, 1 Sep 2015 01:42:04 +0000 (20:42 -0500)]
[dev.ssa] cmd/compile: add more specific regalloc logging

Change-Id: Ib0ea4b9c245f3d551e0f703826caa6b444b56a2d
Reviewed-on: https://go-review.googlesource.com/14136
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: schedule values dependent on the control later
Todd Neal [Sat, 29 Aug 2015 17:51:04 +0000 (12:51 -0500)]
[dev.ssa] cmd/compile: schedule values dependent on the control later

To reduce the number of spills, give any non-phi values whose argument
is the control the same priority as the control.

With mask.bash, this reduces regenerated flags from 603 to 240.

Change-Id: I26883d69e80357c56b343428fb528102b3f26e7a
Reviewed-on: https://go-review.googlesource.com/14042
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: fix typo in log
Todd Neal [Mon, 31 Aug 2015 03:04:38 +0000 (22:04 -0500)]
[dev.ssa] cmd/compile: fix typo in log

Change-Id: Ic7be8fa3a89e46a93df181df3163ec1bf7e96a23
Reviewed-on: https://go-review.googlesource.com/14076
Reviewed-by: Minux Ma <minux@golang.org>
9 years ago[dev.ssa] cmd/compile: add instrumentation to regalloc
Todd Neal [Mon, 31 Aug 2015 02:39:25 +0000 (21:39 -0500)]
[dev.ssa] cmd/compile: add instrumentation to regalloc

Change-Id: Ice206f7e94af4a148d9dd9a7570f5ed21722bedc
Reviewed-on: https://go-review.googlesource.com/14075
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: make test panic on failure
Todd Neal [Mon, 31 Aug 2015 02:21:44 +0000 (21:21 -0500)]
[dev.ssa] cmd/compile: make test panic on failure

Change-Id: Ia5483d23fe0b5dd0b6cfe2099e9b475184742716
Reviewed-on: https://go-review.googlesource.com/14074
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: map EQ/NE intptr to OpEqPtr/OpNeqPtr
Todd Neal [Mon, 31 Aug 2015 01:47:26 +0000 (20:47 -0500)]
[dev.ssa] cmd/compile: map EQ/NE intptr to OpEqPtr/OpNeqPtr

Change-Id: I8fd3727763c812297967c8069847833fc8516ff2
Reviewed-on: https://go-review.googlesource.com/14073
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile/internal/ssa: handle dead code a different way
Keith Randall [Fri, 28 Aug 2015 23:45:17 +0000 (16:45 -0700)]
[dev.ssa] cmd/compile/internal/ssa: handle dead code a different way

Instead of trying to delete dead code as soon as we find it, just
mark it as dead using a PlainAndDead block kind.  The deadcode pass
will do the real removal.

This way is somewhat more efficient because we don't need to mess
with successor and predecessor lists of all the dead blocks.

Fixes #12347

Change-Id: Ia42d6b5f9cdb3215a51737b3eb117c00bd439b13
Reviewed-on: https://go-review.googlesource.com/14033
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: implement PPARAMREF
Josh Bleecher Snyder [Fri, 28 Aug 2015 20:35:32 +0000 (13:35 -0700)]
[dev.ssa] cmd/compile: implement PPARAMREF

This also fixes the encoding/gob TestTopLevelNilPointer failure.

Change-Id: I9b29a6fddffd51af305c685f3a8e2a0594bfeeab
Reviewed-on: https://go-review.googlesource.com/14032
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: move addEdge function to ssa
Todd Neal [Sat, 29 Aug 2015 02:36:29 +0000 (21:36 -0500)]
[dev.ssa] cmd/compile: move addEdge function to ssa

addEdge had two identical implementations so make it an exported method
on Block.

Change-Id: I8c21655a9dc5074fefd7f63b2f5b51897571e608
Reviewed-on: https://go-review.googlesource.com/14040
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: implement OFALL
Todd Neal [Sat, 29 Aug 2015 02:19:40 +0000 (21:19 -0500)]
[dev.ssa] cmd/compile: implement OFALL

Frontend has already rewriten fallthrough statements, we just need to
ignore them.

Change-Id: Iadf89b06a9f8f9e6e2e1e87c934f31add77a19a1
Reviewed-on: https://go-review.googlesource.com/14029
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: implement len/cap(chan)
Todd Neal [Fri, 28 Aug 2015 20:56:43 +0000 (15:56 -0500)]
[dev.ssa] cmd/compile: implement len/cap(chan)

Change-Id: I1453ba226376ccd4d79780fc0686876d6dde01ee
Reviewed-on: https://go-review.googlesource.com/14027
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: added floating point to [u]int conversions
David Chase [Wed, 26 Aug 2015 18:25:40 +0000 (14:25 -0400)]
[dev.ssa] cmd/compile: added floating point to [u]int conversions

Change-Id: I8dee400aef07165f911750de2615b8757f826000
Reviewed-on: https://go-review.googlesource.com/13945
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: allocate complex zero in the entry block
Keith Randall [Fri, 28 Aug 2015 20:52:26 +0000 (13:52 -0700)]
[dev.ssa] cmd/compile/internal/ssa: allocate complex zero in the entry block

Fixes build.  There may be no current block.

Change-Id: I0da8bab133dc207124556927698e7cd682e64ef5
Reviewed-on: https://go-review.googlesource.com/13989
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: fix type of nil ptr in check
Todd Neal [Fri, 28 Aug 2015 20:20:54 +0000 (15:20 -0500)]
[dev.ssa] cmd/compile: fix type of nil ptr in check

Change-Id: If7a6ab6b1336dbacb006f562be7f153eb93e7253
Reviewed-on: https://go-review.googlesource.com/14025
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: add arg-dominating check, fix phielim
Keith Randall [Fri, 28 Aug 2015 19:53:41 +0000 (12:53 -0700)]
[dev.ssa] cmd/compile/internal/ssa: add arg-dominating check, fix phielim

Add a check to make sure value arguments dominate the value.

Phi elim output used to fail this test.  When eliminating
redundant phis, phi elim was using one of the args and not
the ultimate source.  For example:

          b1: x = ...
          -> b2 b3

b2: y = Copy x        b3: z = Copy x
-> b4                 -> b4

          b4: w = phi y z

Phi elim eliminates w, but it used to replace w with (Copy y).
That's bad as b2 does not dominate b4.  Instead we should
replace w with (Copy x).

Fixes #12347

Change-Id: I9f340cdabcda8e2e90359fb4f9250877b1fffe98
Reviewed-on: https://go-review.googlesource.com/13986
Reviewed-by: David Chase <drchase@google.com>
9 years ago[dev.ssa] cmd/compile: add compose/decompose for complex, phi, constants
David Chase [Fri, 28 Aug 2015 18:24:10 +0000 (14:24 -0400)]
[dev.ssa] cmd/compile: add compose/decompose for complex, phi, constants

Still to do: arithmetic

Change-Id: I31fd23b34980c9ed4b4e304b8597134b2ba6ca5c
Reviewed-on: https://go-review.googlesource.com/14024
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: implement len(map)
Todd Neal [Wed, 26 Aug 2015 23:40:52 +0000 (18:40 -0500)]
[dev.ssa] cmd/compile: implement len(map)

Implement len(map) values.

Change-Id: If92be96ec9a7a86aeb3ce566d6758aab01c2fa7d
Reviewed-on: https://go-review.googlesource.com/13961
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: make block kinds clickable in html
Josh Bleecher Snyder [Thu, 27 Aug 2015 17:29:01 +0000 (10:29 -0700)]
[dev.ssa] cmd/compile: make block kinds clickable in html

Change-Id: I113c07caf504cee66a81730da8830de6de098e49
Reviewed-on: https://go-review.googlesource.com/13981
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile: fix OANDAND and OOROR type
Josh Bleecher Snyder [Thu, 27 Aug 2015 17:11:08 +0000 (10:11 -0700)]
[dev.ssa] cmd/compile: fix OANDAND and OOROR type

The old backend doesn't like ideal types,
and we want to reuse its stackmap generation.

OOROR and OANDAND expressions have ideal type.
The old backend didn't care,
because those expressions got rewritten away into
jumps before stackmap generation.

Fix the type during conversion.

Change-Id: I488e7499298d9aec71da39c202f6a7235935bc8d
Reviewed-on: https://go-review.googlesource.com/13980
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile: fix phi floats
Todd Neal [Wed, 26 Aug 2015 03:49:59 +0000 (22:49 -0500)]
[dev.ssa] cmd/compile: fix phi floats

The code previously always used AX causing errors.  For now, just
switch off the type in order to at least generate valid code.

Change-Id: Iaf13120a24b62456b9b33c04ab31f2d5104b381b
Reviewed-on: https://go-review.googlesource.com/13943
Reviewed-by: David Chase <drchase@google.com>
9 years ago[dev.ssa] cmd/compile: support float zeroing
Todd Neal [Wed, 26 Aug 2015 00:21:45 +0000 (19:21 -0500)]
[dev.ssa] cmd/compile: support float zeroing

Change-Id: Iacd302350cf0a8a8164d937e5c4ac55e6a07d380
Reviewed-on: https://go-review.googlesource.com/13942
Reviewed-by: David Chase <drchase@google.com>
9 years ago[dev.ssa] Merge remote-tracking branch 'origin/master' into mergebranch
Keith Randall [Tue, 25 Aug 2015 21:45:41 +0000 (14:45 -0700)]
[dev.ssa] Merge remote-tracking branch 'origin/master' into mergebranch

Semi-regular merge of master into dev.ssa.

Change-Id: Ia7f2e29dfdea7618141efcfcf6f6c7c8b5553dfa

9 years ago[dev.ssa] cmd/compile/internal/ssa: add more critical edges
Keith Randall [Tue, 25 Aug 2015 21:02:30 +0000 (14:02 -0700)]
[dev.ssa] cmd/compile/internal/ssa: add more critical edges

Add blocks to remove critical edges, even when it looks like
there's no phi that requires it.  Regalloc still likes to have
critical-edge-free graphs for other reasons.

Change-Id: I69f8eaecbc5d79ab9f2a257c2e289d60b18e43c8
Reviewed-on: https://go-review.googlesource.com/13933
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years agocmd/compile: fix register allocation for == operator
Ulrich Kunitz [Thu, 20 Aug 2015 16:56:18 +0000 (18:56 +0200)]
cmd/compile: fix register allocation for == operator

The issue 12226 has been caused by the allocation of the same register
for the equality check of two byte values. The code in cgen.go freed the
register for the second operand before the allocation of the register
for the first operand.

Fixes #12226

Change-Id: Ie4dc33a488bd48a17f8ae9b497fd63c1ae390555
Reviewed-on: https://go-review.googlesource.com/13771
Reviewed-by: Russ Cox <rsc@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: update TODO and comments
Keith Randall [Tue, 25 Aug 2015 17:39:23 +0000 (10:39 -0700)]
[dev.ssa] cmd/compile/internal/ssa: update TODO and comments

Change-Id: I3c598faff8af18530ae863b9e72f0cef379b4a1f
Reviewed-on: https://go-review.googlesource.com/13909
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile: implement OSLICESTR
Keith Randall [Tue, 25 Aug 2015 06:52:03 +0000 (23:52 -0700)]
[dev.ssa] cmd/compile: implement OSLICESTR

Add a new function and generic operation to handle
bounds checking for slices. Unlike the index
bounds checking the index can be equal to the upper
bound.

Do gc-friendly slicing that generates proper code for
0-length result slices.

This is a takeover of Alexandru's original change,
(https://go-review.googlesource.com/#/c/12764/)
submittable now that the decompose phase is in.

Change-Id: I17d164cf42ed7839f84ca949c6ad3289269c9160
Reviewed-on: https://go-review.googlesource.com/13903
Reviewed-by: David Chase <drchase@google.com>
9 years ago[dev.ssa] cmd/compile: add FP comparison ops
David Chase [Tue, 18 Aug 2015 18:39:26 +0000 (14:39 -0400)]
[dev.ssa] cmd/compile: add FP comparison ops

Basic ops, no particular optimization in the pattern
matching yet (e.g. x!=x for Nan detection, x cmp constant,
etc.)

Change-Id: I0043564081d6dc0eede876c4a9eb3c33cbd1521c
Reviewed-on: https://go-review.googlesource.com/13704
Reviewed-by: Keith Randall <khr@golang.org>
9 years agocmd/compile: fix uninitialized memory in compare of interface value
Austin Clements [Mon, 24 Aug 2015 17:35:49 +0000 (13:35 -0400)]
cmd/compile: fix uninitialized memory in compare of interface value

A comparison of the form l == r where l is an interface and r is
concrete performs a type assertion on l to convert it to r's type.
However, the compiler fails to zero the temporary where the result of
the type assertion is written, so if the type is a pointer type and a
stack scan occurs while in the type assertion, it may see an invalid
pointer on the stack.

Fix this by zeroing the temporary. This is equivalent to the fix for
type switches from c4092ac.

Fixes #12253.

Change-Id: Iaf205d456b856c056b317b4e888ce892f0c555b9
Reviewed-on: https://go-review.googlesource.com/13872
Reviewed-by: Russ Cox <rsc@golang.org>
9 years ago[dev.ssa] cmd/compile: add [u]int and FP to FP conversions
David Chase [Thu, 20 Aug 2015 19:14:20 +0000 (15:14 -0400)]
[dev.ssa] cmd/compile: add [u]int and FP to FP conversions

Change-Id: I8c17f706a3e0f1fa2d754bfb4ccd1f7a027cb3db
Reviewed-on: https://go-review.googlesource.com/13744
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: make sure to keep offset and sym of MOV opcodes.
Keith Randall [Mon, 24 Aug 2015 04:14:25 +0000 (21:14 -0700)]
[dev.ssa] cmd/compile: make sure to keep offset and sym of MOV opcodes.

MOVXload and MOVXstore opcodes have both an auxint offset
and an aux offset (a symbol name, like a local or arg or global).
Make sure we keep those values during rewrites.

Change-Id: Ic9fd61bf295b5d1457784c281079a4fb38f7ad3b
Reviewed-on: https://go-review.googlesource.com/13849
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years agoruntime: check pointer equality in arm64 cmpbody
Dave Cheney [Tue, 25 Aug 2015 03:12:32 +0000 (13:12 +1000)]
runtime: check pointer equality in arm64 cmpbody

Updates #11336

Follow the lead of amd64 by doing a pointer equality check
before comparing string/byte contents on arm64.

BenchmarkCompareBytesEqual-8               25.8           26.3           +1.94%
BenchmarkCompareBytesToNil-8               9.59           9.59           +0.00%
BenchmarkCompareBytesEmpty-8               9.59           9.17           -4.38%
BenchmarkCompareBytesIdentical-8           26.3           9.17           -65.13%
BenchmarkCompareBytesSameLength-8          16.3           16.3           +0.00%
BenchmarkCompareBytesDifferentLength-8     16.3           16.3           +0.00%
BenchmarkCompareBytesBigUnaligned-8        1132038        1131409        -0.06%
BenchmarkCompareBytesBig-8                 1126758        1128470        +0.15%
BenchmarkCompareBytesBigIdentical-8        1084366        9.17           -100.00%

Change-Id: Id7125c31957eff1ddb78897d4511bd50e79af3f7
Reviewed-on: https://go-review.googlesource.com/13885
Reviewed-by: Keith Randall <khr@golang.org>
9 years agoruntime: fix nmspinning comparison
Todd Neal [Tue, 25 Aug 2015 00:11:35 +0000 (19:11 -0500)]
runtime: fix nmspinning comparison

nmspinning has a value range of [0, 2^31-1].  Update the comment to
indicate this and fix the comparison so it's not always false.

Fixes #11280

Change-Id: Iedaf0654dcba5e2c800645f26b26a1a781ea1991
Reviewed-on: https://go-review.googlesource.com/13877
Reviewed-by: Minux Ma <minux@golang.org>
9 years agoruntime: add a missing hex conversion
Shenghou Ma [Tue, 25 Aug 2015 01:24:23 +0000 (21:24 -0400)]
runtime: add a missing hex conversion

gobuf.g is a guintptr, so without hex(), it will be printed as
a decimal, which is not very helpful and inconsistent with how
other pointers are printed.

Change-Id: I7c0432e9709e90a5c3b3e22ce799551a6242d017
Reviewed-on: https://go-review.googlesource.com/13879
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agodebug/elf: map/slice literals janitoring
Didier Spezia [Sun, 23 Aug 2015 13:59:00 +0000 (13:59 +0000)]
debug/elf: map/slice literals janitoring

Simplify slice/map literal expressions.
Caught with gofmt -d -s, fixed with gofmt -w -s
Reformatted some expressions to improve readability.

Change-Id: Iaf123e6bd49162ec45c59297ad3b002ca59443bc
Reviewed-on: https://go-review.googlesource.com/13850
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/go: skip test using external linking on linux/ppc64 too
Shenghou Ma [Tue, 25 Aug 2015 01:17:04 +0000 (21:17 -0400)]
cmd/go: skip test using external linking on linux/ppc64 too

While we're at it, also fix a typo.

Change-Id: Id436f33cffa5683e2a8450cce5b545960cf2877e
Reviewed-on: https://go-review.googlesource.com/13878
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoencoding/gob: remove always false comparison
Todd Neal [Mon, 24 Aug 2015 23:30:53 +0000 (18:30 -0500)]
encoding/gob: remove always false comparison

This is not a functional change. nr is a uint64 and can never be less
than zero, remove the no-op comparison.

Fixes #11279

Change-Id: Iebb36cc8fe97428b503e65d01b5e67d2b2bc7369
Reviewed-on: https://go-review.googlesource.com/13876
Run-TryBot: Todd Neal <todd@tneal.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agoos/signal: skip the nohup test on darwin when running in tmux.
Aaron Jacobs [Mon, 24 Aug 2015 22:53:42 +0000 (08:53 +1000)]
os/signal: skip the nohup test on darwin when running in tmux.

The nohup command doesn't work in tmux on darwin.

Fixes #5135.

Change-Id: I1c21073d8bd54b49dd6b0bad86ef088d6d8e7a5f
Reviewed-on: https://go-review.googlesource.com/13883
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile: streamline unimplemented strings
Josh Bleecher Snyder [Mon, 24 Aug 2015 03:29:43 +0000 (20:29 -0700)]
[dev.ssa] cmd/compile: streamline unimplemented strings

This aids in making sense of the aggregate set of work outstanding.
Interest in the details of any particular implementation failure
is better handled locally anyway.

In my local tree, running make.bash after this CL yields:

 14.85%  1811 SSA unimplemented: unhandled expr SLICEARR
 13.84%  1687 SSA unimplemented: unhandled expr CALLINTER
 11.84%  1444 SSA unimplemented: unhandled stmt RETJMP
 10.24%  1249 SSA unimplemented: unhandled expr EFACE
  8.52%  1039 SSA unimplemented: unhandled expr SLICE
  4.92%   600 SSA unimplemented: local variable with class PAUTO,heap unimplemented
  4.90%   598 SSA unimplemented: unhandled expr SLICESTR
  3.91%   477 SSA unimplemented: local variable with class PFUNC unimplemented
  3.45%   421 SSA unimplemented: not lowered: IMake INTER PTR64 PTR64
  3.42%   417 SSA unimplemented: unhandled expr APPEND
  3.21%   391 SSA unimplemented: unhandled expr CLOSUREVAR
  3.06%   373 SSA unimplemented: unhandled stmt DEFER
  3.04%   371 SSA unimplemented: unhandled stmt AS2DOTTYPE
  1.61%   196 SSA unimplemented: unhandled expr DOTTYPE
  1.56%   190 SSA unimplemented: not lowered: Load STRUCT PTR64 mem
  0.79%    96 SSA unimplemented: not lowered: StringMake STRING PTR64 UINTPTR
  0.69%    84 SSA unimplemented: unhandled binary op NE FLOAT64
  0.53%    65 SSA unimplemented: unhandled expr STRUCTLIT
  0.50%    61 SSA unimplemented: not lowered: SliceMake ARRAY PTR64 UINTPTR UINTPTR
  0.45%    55 SSA unimplemented: zero for type float64 not implemented
  0.44%    54 SSA unimplemented: unhandled addr CLOSUREVAR
  0.38%    46 SSA unimplemented: unhandled binary op EQ FLOAT64
  0.35%    43 SSA unimplemented: unhandled binary op LT FLOAT64
  0.34%    42 SSA unimplemented: unhandled len(map)
  0.33%    40 SSA unimplemented: unhandled stmt FALL
  0.23%    28 SSA unimplemented: CONVNOP closure
  0.21%    25 SSA unimplemented: local variable with class PPARAM,heap unimplemented
  0.21%    25 SSA unimplemented: unhandled binary op GT FLOAT64
  0.18%    22 SSA unimplemented: unhandled OCONV FLOAT32 -> FLOAT64
  0.18%    22 SSA unimplemented: unhandled expr REAL
  0.16%    20 SSA unimplemented: unhandled stmt PROC
  0.16%    19 SSA unimplemented: unhandled closure arg
  0.15%    18 SSA unimplemented: unhandled OCONV INT64 -> FLOAT64
  0.12%    15 SSA unimplemented: unhandled expr CFUNC
  0.10%    12 SSA unimplemented: unhandled OCONV UINT64 -> FLOAT64
  0.09%    11 SSA unimplemented: unhandled OLITERAL 4
  0.09%    11 SSA unimplemented: unhandled expr IMAG
  0.07%     9 SSA unimplemented: unhandled binary op GE FLOAT64
  0.07%     9 SSA unimplemented: unhandled binary op MINUS FLOAT64
  0.06%     7 SSA unimplemented: unhandled OCONV FLOAT64 -> FLOAT32
  0.06%     7 SSA unimplemented: unhandled binary op NE FLOAT32
  0.06%     7 SSA unimplemented: variable address class 5 not implemented
  0.05%     6 SSA unimplemented: not lowered: Load COMPLEX128 PTR64 mem
  0.05%     6 SSA unimplemented: unhandled expr SLICE3ARR
  0.04%     5 SSA unimplemented: unhandled binary op LE FLOAT64
  0.03%     4 SSA unimplemented: unhandled OCONV UINTPTR -> FLOAT64
  0.03%     4 SSA unimplemented: unhandled binary op EQ COMPLEX128
  0.03%     4 SSA unimplemented: unhandled binary op EQ FLOAT32
  0.03%     4 SSA unimplemented: unhandled expr COMPLEX
  0.02%     3 SSA unimplemented: local variable with class PPARAMOUT,heap unimplemented
  0.02%     3 SSA unimplemented: not lowered: Load ARRAY PTR64 mem
  0.02%     3 SSA unimplemented: unhandled OCONV INT32 -> FLOAT64
  0.02%     3 SSA unimplemented: unhandled OCONV INT64 -> FLOAT32
  0.02%     3 SSA unimplemented: unhandled expr SLICE3
  0.02%     2 SSA unimplemented: unhandled OCONV COMPLEX64 -> COMPLEX128
  0.02%     2 SSA unimplemented: unhandled OCONV FLOAT64 -> INT64
  0.02%     2 SSA unimplemented: unhandled OCONV FLOAT64 -> UINT64
  0.02%     2 SSA unimplemented: unhandled OCONV INT -> FLOAT64
  0.02%     2 SSA unimplemented: unhandled OCONV UINT64 -> FLOAT32
  0.02%     2 SSA unimplemented: unhandled binary op EQ COMPLEX64
  0.02%     2 SSA unimplemented: unhandled binary op MINUS FLOAT32
  0.02%     2 SSA unimplemented: zero for type complex128 not implemented
  0.02%     2 SSA unimplemented: zero for type complex64 not implemented
  0.02%     2 SSA unimplemented: zero for type float32 not implemented
  0.01%     1 SSA unimplemented: not lowered: EqFat BOOL INTER INTER
  0.01%     1 SSA unimplemented: not lowered: Store mem UINTPTR COMPLEX128 mem
  0.01%     1 SSA unimplemented: unhandled OCONV UINT32 -> FLOAT64
  0.01%     1 SSA unimplemented: unhandled cap(chan)
  0.01%     1 SSA unimplemented: unhandled expr ARRAYLIT
  0.01%     1 SSA unimplemented: unhandled expr PLUS
  0.01%     1 SSA unimplemented: unhandled stmt CHECKNIL

Change-Id: I43474fe6d6ec22a9f57239090136f6e97eebfdf2
Reviewed-on: https://go-review.googlesource.com/13848
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: support spilling and loading flags
Josh Bleecher Snyder [Sun, 23 Aug 2015 02:38:12 +0000 (19:38 -0700)]
[dev.ssa] cmd/compile: support spilling and loading flags

This CL takes a simple approach to spilling and loading flags.
We never spill. When a load is needed, we recalculate,
loading the arguments as needed.

This is simple and architecture-independent.
It is not very efficient, but as of this CL,
there are fewer than 200 flag spills during make.bash.

This was tested by manually reverting CLs 13813 and 13843,
causing SETcc, MOV, and LEA instructions to clobber flags,
which dramatically increases the number of flags spills.
With that done, all stdlib tests that used to pass
still pass.

For future reference, here are some other, more efficient
amd64-only schemes that we could adapt in the future if needed.

(1) Spill exactly the flags needed.

For example, if we know that the flags will be needed
by a SETcc or Jcc op later, we could use SETcc to
extract just the relevant flag. When needed,
we could use TESTB and change the op to JNE/SETNE.
(Alternatively, we could leave the op unaltered
and prepare an appropriate CMPB instruction
to produce the desired flag.)

However, this requires separate handling for every
instruction that uses the flags register,
including (say) SBBQcarrymask.

We could enable this on an ad hoc basis for common cases
and fall back to recalculation for other cases.

(2) Spill all flags with PUSHF and POPF

This modifies SP, which the runtime won't like.
It also requires coordination with stackalloc to
make sure that we have a stack slot ready for use.

(3) Spill almost all flags with LAHF, SETO, and SAHF

See http://blog.freearrow.com/archives/396
for details. This would handle all the flags we currently
use. However, LAHF and SAHF are not universally available
and it requires arranging for AX to be free.

Change-Id: Ie36600fd8e807ef2bee83e2e2ae3685112a7f276
Reviewed-on: https://go-review.googlesource.com/13844
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: mark LEA and MOV instructions as not clobbering flags
Josh Bleecher Snyder [Sat, 22 Aug 2015 16:52:36 +0000 (09:52 -0700)]
[dev.ssa] cmd/compile: mark LEA and MOV instructions as not clobbering flags

This further reduces the number of flags spills
during make.bash by about 50%.

Note that GetG is implemented by one or two MOVs,
which is why it does not clobber flags.

Change-Id: I6fede8c027b7dc340e00d1e15df1b87bf2b2d9ec
Reviewed-on: https://go-review.googlesource.com/13843
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: make "*Value".String more robust
Josh Bleecher Snyder [Sat, 22 Aug 2015 20:30:45 +0000 (13:30 -0700)]
[dev.ssa] cmd/compile: make "*Value".String more robust

Change-Id: I4ae38440a33574421c9e3e350701e86e8a224b92
Reviewed-on: https://go-review.googlesource.com/13842
Reviewed-by: Todd Neal <todd@tneal.org>
Reviewed-by: Keith Randall <khr@golang.org>
9 years agohash/fnv: fix wiki url
Joe Tsai [Thu, 6 Aug 2015 08:49:00 +0000 (01:49 -0700)]
hash/fnv: fix wiki url

The URL is shown on go docs and is an eye-sore.

For go1.6.

Change-Id: I8b8ea3751200d06ed36acfe22f47ebb38107f8db
Reviewed-on: https://go-review.googlesource.com/13282
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoruntime: check pointer equality in arm cmpbody
Dave Cheney [Mon, 24 Aug 2015 05:07:58 +0000 (15:07 +1000)]
runtime: check pointer equality in arm cmpbody

Updates #11336

Follow the lead of amd64 do a pointer equality check
before comparing string/byte contents on arm.

BenchmarkCompareBytesEqual-4               208             211             +1.44%
BenchmarkCompareBytesToNil-4               83.6            81.8            -2.15%
BenchmarkCompareBytesEmpty-4               80.2            75.2            -6.23%
BenchmarkCompareBytesIdentical-4           208             75.2            -63.85%
BenchmarkCompareBytesSameLength-4          126             128             +1.59%
BenchmarkCompareBytesDifferentLength-4     128             130             +1.56%
BenchmarkCompareBytesBigUnaligned-4        14192804        14060971        -0.93%
BenchmarkCompareBytesBig-4                 12277313        12128193        -1.21%
BenchmarkCompareBytesBigIdentical-4        9385046         78.5            -100.00%

Change-Id: I5b24620018688c5fe04b6ff6743a24c4ce225788
Reviewed-on: https://go-review.googlesource.com/13881
Reviewed-by: Keith Randall <khr@golang.org>
9 years agofmt: in Scanf, %c can scan a space, so don't skip spaces at %c
Rob Pike [Sun, 23 Aug 2015 07:45:58 +0000 (17:45 +1000)]
fmt: in Scanf, %c can scan a space, so don't skip spaces at %c

In short, %c should just give you the next rune, period.
Apparently this is the design. I use the term loosely.

Fixes #12275

Change-Id: I6f30bed442c0e88eac2244d465c7d151b29cf393
Reviewed-on: https://go-review.googlesource.com/13821
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agodoc: remove mention of defunct golang-bugs mailing list
Andrew Gerrand [Mon, 24 Aug 2015 19:43:54 +0000 (05:43 +1000)]
doc: remove mention of defunct golang-bugs mailing list

Fixes #12299

Change-Id: Id7b73d2935c9f7c0952f833613973ef455d02b0d
Reviewed-on: https://go-review.googlesource.com/13858
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoencoding/asn1: fix unused assignments
Tarmigan Casebolt [Mon, 24 Aug 2015 02:51:22 +0000 (19:51 -0700)]
encoding/asn1: fix unused assignments

Unused assignment for `err` encoding/asn1/marshal.go:622:3
Unused assignment for `err` encoding/asn1/marshal.go:650:5

Change-Id: I4226238645ce3640f25124cb405444e61439fd3f
Reviewed-on: https://go-review.googlesource.com/13847
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agonet: allow ParseMAC to parse 20-octet IPoIB link-layer address
Matt Layher [Fri, 17 Jul 2015 21:28:42 +0000 (17:28 -0400)]
net: allow ParseMAC to parse 20-octet IPoIB link-layer address

Fixes #11763

Change-Id: Ie291b36a8c29694e80940836d7e6fd96d2d76494
Reviewed-on: https://go-review.googlesource.com/12382
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

9 years agoimage/gif: avoid unused assignment
Tarmigan Casebolt [Mon, 24 Aug 2015 02:51:28 +0000 (19:51 -0700)]
image/gif: avoid unused assignment

Change-Id: Iaaecd8be9268c923f40cf0e5153cbf79f7015b8d
Reviewed-on: https://go-review.googlesource.com/13892
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agounicode: include rune 0 in RangeTables.
Marcel van Lohuizen [Wed, 19 Aug 2015 18:28:18 +0000 (20:28 +0200)]
unicode: include rune 0 in RangeTables.

All of Go passes. No changes for the text repo.

Fixes #10153

Change-Id: I313369bf471c8974390a6d42075e5c54f6a81750
Reviewed-on: https://go-review.googlesource.com/13667
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
9 years agogo/internal/gcimporter: remove unused assignment
Tarmigan Casebolt [Mon, 24 Aug 2015 02:51:24 +0000 (19:51 -0700)]
go/internal/gcimporter: remove unused assignment

Change-Id: I0b19731a46e4e67a7dd503dd133cafc7678760a7
Reviewed-on: https://go-review.googlesource.com/13890
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agomath: avoid unused assignment in jn.go
Tarmigan Casebolt [Mon, 24 Aug 2015 02:51:33 +0000 (19:51 -0700)]
math: avoid unused assignment in jn.go

Change-Id: Ie4f21bcd5849e994c63ec5bbda2dee6f3ec4da12
Reviewed-on: https://go-review.googlesource.com/13891
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agointernal/syscall/windows/registry: remove debugging dreg
Alex Brainman [Mon, 24 Aug 2015 03:49:30 +0000 (13:49 +1000)]
internal/syscall/windows/registry: remove debugging dreg

Change-Id: I1b9f6ad322a7f68fa160c4f09d7fb56815e505a7
Reviewed-on: https://go-review.googlesource.com/13828
Reviewed-by: Rob Pike <r@golang.org>
9 years agomake.bash: abort if $GOROOT_BOOTSTRAP == $GOROOT
Dave Cheney [Thu, 20 Aug 2015 02:28:51 +0000 (12:28 +1000)]
make.bash: abort if $GOROOT_BOOTSTRAP == $GOROOT

Fixes #12214

Change-Id: I82586b54ac7b9c0c71055bb66b921e3efbf4977c
Reviewed-on: https://go-review.googlesource.com/13719
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agocmd/internal/obj: delete Debugzerostack dead code
Josh Bleecher Snyder [Sun, 23 Aug 2015 03:31:55 +0000 (20:31 -0700)]
cmd/internal/obj: delete Debugzerostack dead code

Fixes #11060

Change-Id: I4c6647fc2f103015b67e30dc2cdb6f771526c139
Reviewed-on: https://go-review.googlesource.com/13840
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet: drop redundant domain name length check
Mikio Hara [Sat, 22 Aug 2015 02:03:11 +0000 (11:03 +0900)]
net: drop redundant domain name length check

It is already validated by isDoaminName.

Change-Id: I7a955b632a5143e16b012641cf12bad452900753
Reviewed-on: https://go-review.googlesource.com/13789
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agomime: move examples to external test file
Andrew Gerrand [Sat, 22 Aug 2015 09:40:01 +0000 (10:40 +0100)]
mime: move examples to external test file

Fixes #11257

Change-Id: I3f75db47b0f8e877d81e3c2dcea01ff747b47685
Reviewed-on: https://go-review.googlesource.com/13779
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/compile: in usage messages, name the binary "compile" instead of "Xg"
Brad Fitzpatrick [Sat, 22 Aug 2015 11:29:33 +0000 (20:29 +0900)]
cmd/compile: in usage messages, name the binary "compile" instead of "Xg"

Fixes #12227

Change-Id: I7c1b93e50736185a641fb637000aae2f15bc04ed
Reviewed-on: https://go-review.googlesource.com/13820
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile/internal: mark len(map), len/cap(chan) unimplemented
Todd Neal [Sat, 22 Aug 2015 02:38:41 +0000 (21:38 -0500)]
[dev.ssa] cmd/compile/internal: mark len(map), len/cap(chan) unimplemented

Mark these as unimplemented so we don't generate bad code.

Change-Id: I101190c40a753faaa82193ac37e2978b20a96e4e
Reviewed-on: https://go-review.googlesource.com/13748
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years agohtml: speed up UnescapeString
Ingo Oeser [Sat, 9 May 2015 15:55:05 +0000 (17:55 +0200)]
html: speed up UnescapeString

Add benchmarks for for sparsely escaped and densely escaped strings.
Then speed up the sparse unescaping part heavily by using IndexByte and
copy to skip the parts containing no escaping very fast.

Unescaping densely escaped strings slower because of
the new function call overhead. But sparsely encoded strings are seen
more often in the utf8 enabled web.

We win part of the speed back by looking up entityName differently.

benchmark                  old ns/op    new ns/op    delta
BenchmarkEscape                31680        31396   -0.90%
BenchmarkEscapeNone             6507         6872   +5.61%
BenchmarkUnescape              36481        48298  +32.39%
BenchmarkUnescapeNone            332          325   -2.11%
BenchmarkUnescapeSparse         8836         3221  -63.55%
BenchmarkUnescapeDense         30639        32224   +5.17%

Change-Id: If606cb01897a40eefe35ba98f2ff23bb25251606
Reviewed-on: https://go-review.googlesource.com/10172
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agotime: Use AppendFormat in Marshal[Text|JSON]
Justin Nuß [Sun, 31 May 2015 11:17:59 +0000 (13:17 +0200)]
time: Use AppendFormat in Marshal[Text|JSON]

The current implementations of MarshalJSON and MarshalText use
time.Format which returns a string (converted from a byte slice),
only to convert it back to a byte slice.

Avoid the conversion (and thus an allocation) by directly appending
the formatted time to a preallocated byte slice, using the new
AppendFormat function, introduced in golang.org/cl/1760.

This reduces the allocations done in Marshal[Text|JSON] by 50%.

benchmark                old ns/op     new ns/op     delta
BenchmarkMarshalJSON     626           507           -19.01%
BenchmarkMarshalText     598           511           -14.55%

benchmark                old allocs     new allocs     delta
BenchmarkMarshalJSON     2              1              -50.00%
BenchmarkMarshalText     2              1              -50.00%

benchmark                old bytes     new bytes     delta
BenchmarkMarshalJSON     96            48            -50.00%
BenchmarkMarshalText     96            48            -50.00%

Fixes #11025

Change-Id: I468f78d075a6ecc1cdc839df7fb407fbc6ff2e70
Reviewed-on: https://go-review.googlesource.com/10555
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/compile/internal, cmd/internal/obj: used keyed ProgInfo literals
Brad Fitzpatrick [Sat, 30 May 2015 22:08:46 +0000 (15:08 -0700)]
cmd/compile/internal, cmd/internal/obj: used keyed ProgInfo literals

Safer, more readable, shorter.

Change-Id: I5cf1f438e20a3df45fc43cc5c870a533f7c524bf
Reviewed-on: https://go-review.googlesource.com/10517
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/compile: allow huge rsh in constants arithmetic
Alberto Donizetti [Thu, 20 Aug 2015 15:53:41 +0000 (17:53 +0200)]
cmd/compile: allow huge rsh in constants arithmetic

Currently an expression like

var v = 0 >> 1000

is rejected by gc with a "stupid shift" error, while gotype
compiles it successfully.

As suggested by gri on the issue tracker, allow an rsh right
operand to be any valid uint value.

Fixes #11328

Change-Id: I6ccb3b7f842338d91fd26ae37dd4fa279d7fc440
Reviewed-on: https://go-review.googlesource.com/13777
Reviewed-by: Robert Griesemer <gri@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: implement OMOD
Todd Neal [Wed, 19 Aug 2015 00:51:44 +0000 (19:51 -0500)]
[dev.ssa] cmd/compile/internal/ssa: implement OMOD

Change-Id: Iec954c4daefef4ab3fa2c98bfb2c70b2dea8dffb
Reviewed-on: https://go-review.googlesource.com/13743
Reviewed-by: Keith Randall <khr@golang.org>
9 years agocmd/compile/internal/big: update vendored math/big
Robert Griesemer [Fri, 21 Aug 2015 18:33:25 +0000 (11:33 -0700)]
cmd/compile/internal/big: update vendored math/big

This updates the big package used by the compiler to match the
public big package which contains some updates and bug fixes.
Obtained by running vendor.bash in the internal/big directory.
No manual changes.

Change-Id: I299aecc6599d4a745a721ce48def32449640dbb2
Reviewed-on: https://go-review.googlesource.com/13815
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agomath/big: fix TestBytes test
Robert Griesemer [Fri, 21 Aug 2015 18:30:19 +0000 (11:30 -0700)]
math/big: fix TestBytes test

Fixes #12231.

Change-Id: I1f07c444623cd864667e21b2fee534eacdc193bb
Reviewed-on: https://go-review.googlesource.com/13814
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/trace: don't fail when no browser is available
David du Colombier [Fri, 21 Aug 2015 18:31:50 +0000 (20:31 +0200)]
cmd/trace: don't fail when no browser is available

When there is no browser available on the system,
we should print the URL instead of failing.

Change-Id: I4a2b099e17609394273eff150062c285d76bbac1
Reviewed-on: https://go-review.googlesource.com/13774
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
9 years ago[dev.ssa] cmd/compile: everything is live and reachable after regalloc
Josh Bleecher Snyder [Fri, 21 Aug 2015 17:15:15 +0000 (10:15 -0700)]
[dev.ssa] cmd/compile: everything is live and reachable after regalloc

This CL makes function printing and HTML generation
accurate after regalloc.

Prior to this CL, text and HTML function outputs
showed live values and blocks as dead.

Change-Id: I70669cd8641af841447fc5d2ecbd754b281356f0
Reviewed-on: https://go-review.googlesource.com/13812
Reviewed-by: Keith Randall <khr@golang.org>
9 years agomath/big: correctly handle large exponent in SetString
Alberto Donizetti [Fri, 21 Aug 2015 17:17:18 +0000 (19:17 +0200)]
math/big: correctly handle large exponent in SetString

Even though the umul/uquo functions expect two valid, finite big.Floats
arguments, SetString was calling them with possibly Inf values, which
resulted in bogus return values.

Replace umul and udiv calls with Mul and Quo calls to fix this. Also,
fix two wrong tests.

See relevant issue on issue tracker for a detailed explanation.

Fixes #11341

Change-Id: Ie35222763a57a2d712a5f5f7baec75cab8189a53
Reviewed-on: https://go-review.googlesource.com/13778
Reviewed-by: Robert Griesemer <gri@golang.org>
9 years ago[dev.ssa] cmd/compile: SETcc instructions do not clobber flags
Josh Bleecher Snyder [Fri, 21 Aug 2015 17:16:35 +0000 (10:16 -0700)]
[dev.ssa] cmd/compile: SETcc instructions do not clobber flags

This reduces the number of flags spilled during
make.bash by > 90%.

I am working (slowly) on the rest.

Change-Id: I3c08ae228c33e2f726f615962996f0350c8d592b
Reviewed-on: https://go-review.googlesource.com/13813
Reviewed-by: David Chase <drchase@google.com>
9 years agomath/big: remove superfluous comparison
Robert Griesemer [Fri, 19 Jun 2015 17:49:42 +0000 (10:49 -0700)]
math/big: remove superfluous comparison

This is not a functional change.

Also:
- minor cleanups, better comments
- uniform spelling of noun "zeros" (per OED)

Fixes #11277.

Change-Id: I1726f358ce15907bd2410f646b02cf8b11b919cd
Reviewed-on: https://go-review.googlesource.com/11267
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
9 years agoruntime/cgo: remove __stack_chk_fail_local
Hyang-Ah (Hana) Kim [Thu, 13 Aug 2015 13:05:22 +0000 (09:05 -0400)]
runtime/cgo: remove __stack_chk_fail_local

I cannot find where it's being used.

This addresses a duplicate symbol issue encountered in golang/go#9327.

Change-Id: I8efda45a006ad3e19423748210c78bd5831215e0
Reviewed-on: https://go-review.googlesource.com/13615
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime, syscall: remove unused bits from Solaris implementation
Shawn Walker-Salas [Thu, 30 Jul 2015 20:32:55 +0000 (13:32 -0700)]
runtime, syscall: remove unused bits from Solaris implementation

CL 9184 changed the runtime and syscall packages to link Solaris binaries
directly instead of using dlopen/dlsym but did not remove the unused (and
now broken) references to dlopen, dlclose, and dlsym.

Fixes #11923

Change-Id: I36345ce5e7b371bd601b7d48af000f4ccacd62c0
Reviewed-on: https://go-review.googlesource.com/13410
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
9 years agodoc: fix typo in release notes
Rob Pike [Thu, 20 Aug 2015 01:46:05 +0000 (11:46 +1000)]
doc: fix typo in release notes

Change-Id: I5310cef72e714b22bcf2ae9e6fd85dbb7e8a15a2
Reviewed-on: https://go-review.googlesource.com/13787
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoall: fix some vet-caught formatting errors, mostly but not only in tests
Rob Pike [Tue, 11 Aug 2015 05:29:40 +0000 (15:29 +1000)]
all: fix some vet-caught formatting errors, mostly but not only in tests

Could go in 1.5, although not critical.
See also #12107

Change-Id: I7f1608b58581d21df4db58f0db654fef79e33a90
Reviewed-on: https://go-review.googlesource.com/13481
Reviewed-by: Dave Cheney <dave@cheney.net>
9 years agogo/types: fix complex(a, b) for untyped arguments a, b
Robert Griesemer [Thu, 30 Jul 2015 22:00:50 +0000 (15:00 -0700)]
go/types: fix complex(a, b) for untyped arguments a, b

R=1.6

Fixes #11669.

Change-Id: Id39e5401e991e46f014eb16b747f5d9b7b55b46a
Reviewed-on: https://go-review.googlesource.com/12937
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agogo/types: don't crash for erroneous program involving a shift in a declaration cycle
Robert Griesemer [Tue, 28 Jul 2015 22:44:19 +0000 (15:44 -0700)]
go/types: don't crash for erroneous program involving a shift in a declaration cycle

R=1.6

Fixes #11347.

Change-Id: Ic6b09f38682500ffcc8d1f96e58f7237a7528806
Reviewed-on: https://go-review.googlesource.com/12812
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agogo/types: convert untyped switch expressions to default type
Robert Griesemer [Mon, 27 Jul 2015 22:23:17 +0000 (15:23 -0700)]
go/types: convert untyped switch expressions to default type

R=1.6

Fixes #11667.
Fixes #11687.

Change-Id: I060db212e8e0ee35fdefb4d482398f8f71650b38
Reviewed-on: https://go-review.googlesource.com/12713
Reviewed-by: Alan Donovan <adonovan@google.com>
9 years agoos/user: don't depend on _SC_GETPW_R_SIZE_MAX on Linux
Dominik Honnef [Sun, 21 Jun 2015 18:07:29 +0000 (20:07 +0200)]
os/user: don't depend on _SC_GETPW_R_SIZE_MAX on Linux

Even Linux systems may not have _SC_GETPW_R_SIZE_MAX if using a
different libc than glibc (e.g. musl). Instead of having special-cases
for the BSDs, handle -1 correctly by always using a default buffer size.

Fixes #11319.

Change-Id: I8b1b260eb9830e6dbe7667f3f33d115ae4de4ce8
Reviewed-on: https://go-review.googlesource.com/13772
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>

9 years agoencoding/base64: fix copy-paste-o bug in RawURLEncoding docs
Brad Fitzpatrick [Fri, 21 Aug 2015 02:06:04 +0000 (11:06 +0900)]
encoding/base64: fix copy-paste-o bug in RawURLEncoding docs

Fixes #12244

Change-Id: Iee4e45d9bca0718c71fcc574bc51b2084c3dcb2a
Reviewed-on: https://go-review.googlesource.com/13783
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: add decompose pass
Keith Randall [Tue, 18 Aug 2015 17:26:28 +0000 (10:26 -0700)]
[dev.ssa] cmd/compile: add decompose pass

Decompose breaks compound objects up into pieces that can be
operated on by the target architecture.  The decompose pass only
does phi ops, the rest is done by the rewrite rules in generic.rules.

Compound objects include strings,slices,interfaces,structs,arrays.

Arrays aren't decomposed because of indexing (we could support
constant indexes, but dynamic indexes can't be handled using SSA).
Structs will come in a subsequent CL.

TODO: after this pass we have lost the association between, e.g.,
a string's pointer and its size.  It would be nice if we could keep
that information around for debugging info somehow.

Change-Id: I6379ab962a7beef62297d0f68c421f22aa0a0901
Reviewed-on: https://go-review.googlesource.com/13683
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years agonet/http: document that [ListenAnd]Serve always returns a non-nil error
Andrew Gerrand [Thu, 20 Aug 2015 11:56:24 +0000 (11:56 +0000)]
net/http: document that [ListenAnd]Serve always returns a non-nil error

Fixes #12229

Change-Id: I243e39f67748e6754fb7726b21b3afc1ff436771
Reviewed-on: https://go-review.googlesource.com/13780
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/go: fix vendoredImportPath comment
David Glasser [Wed, 19 Aug 2015 17:38:54 +0000 (10:38 -0700)]
cmd/go: fix vendoredImportPath comment

Change-Id: I1650124dd459dc401ccd73943ff7287b1b8c57e4
Reviewed-on: https://go-review.googlesource.com/13689
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years ago[dev.ssa] cmd/compile: implement more panic stuff
Keith Randall [Tue, 18 Aug 2015 22:25:40 +0000 (15:25 -0700)]
[dev.ssa] cmd/compile: implement more panic stuff

Implement index check panics (and slice check panics, for when
we need those).

Clean up nil check.  Now that the new regalloc is in we can use
the register we just tested as the address 0 destination.

Remove jumps after panic calls, they are unreachable.

Change-Id: Ifee6e510cdea49cc7c7056887e4f06c67488d491
Reviewed-on: https://go-review.googlesource.com/13687
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: used Bounded field to fix empty range loops
Keith Randall [Tue, 18 Aug 2015 21:17:30 +0000 (14:17 -0700)]
[dev.ssa] cmd/compile: used Bounded field to fix empty range loops

    for i, v := range a {
    }

Walk converts this to a regular for loop, like this:

    for i := 0, p := &a[0]; i < len(a); i++, p++ {
        v := *p
    }

Unfortunately, &a[0] fails its bounds check when a is
the empty slice (or string).  The old compiler gets around this
by marking &a[0] as Bounded, meaning "don't emit bounds checks
for this index op".  This change makes SSA honor that same mark.

The SSA compiler hasn't implemented bounds check panics yet,
so the failed bounds check just causes the current routine
to return immediately.

Fixes bytes package tests.

Change-Id: Ibe838853ef4046c92f76adbded8cca3b1e449e0b
Reviewed-on: https://go-review.googlesource.com/13685
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years agodoc: document Go 1.5 on release page
Russ Cox [Wed, 19 Aug 2015 03:55:28 +0000 (23:55 -0400)]
doc: document Go 1.5 on release page

This makes sure the release page in the release will mention the release.

Fixes #12102.

Change-Id: I36befd7dba7ba9e70ae3335e21c8841179ac4eff
Reviewed-on: https://go-review.googlesource.com/13490
Reviewed-by: Rob Pike <r@golang.org>
9 years agonet: respect go vs cgo resolver selection in all lookup routines
Russ Cox [Wed, 19 Aug 2015 02:50:12 +0000 (22:50 -0400)]
net: respect go vs cgo resolver selection in all lookup routines

This is especially important for LookupAddr, which used to be pure Go
(lightweight, one goroutine per call) and without this CL is now
unconditionally cgo (heavy, one thread per call).

Fixes #12190.

Change-Id: I43436a942bc1838b024225893e156f280a1e80cf
Reviewed-on: https://go-review.googlesource.com/13698
Reviewed-by: Rob Pike <r@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agonet: force LookupAddr results to be rooted DNS paths when using cgo
Russ Cox [Wed, 19 Aug 2015 02:19:58 +0000 (22:19 -0400)]
net: force LookupAddr results to be rooted DNS paths when using cgo

Go 1.4 and before have always returned DNS names with a trailing dot
for reverse lookups, as they do for basically all other routines returning
DNS names. Go 1.4 and before always implemented LookupAddr using
pure Go (not C library calls).

Go 1.5 added the ability to make a C library call to implement LookupAddr.
Unfortunately the C library call returns a DNS name without a trailing dot
(an unrooted name), meaning that if turn off cgo during make.bash then
you still get the rooted name but with cgo on you get an unrooted name.
The unrooted name is inconsistent with the pure Go implementation
and with all previous Go releases, so change it to a rooted name.

Fixes #12189.

Change-Id: I3d6b72277c121fe085ea6af30e5fe8019fc490ad
Reviewed-on: https://go-review.googlesource.com/13697
Reviewed-by: Rob Pike <r@golang.org>
9 years agonet: document GODEBUG=netdns=xxx settings
Russ Cox [Wed, 19 Aug 2015 03:19:41 +0000 (23:19 -0400)]
net: document GODEBUG=netdns=xxx settings

Fixes #12191.

Change-Id: I5c7659ccb0566dad3613041d9e76be87ceacae61
Reviewed-on: https://go-review.googlesource.com/13700
Reviewed-by: Rob Pike <r@golang.org>
9 years agodoc: fix typos in go1.5.html
Rob Pike [Wed, 19 Aug 2015 03:44:33 +0000 (13:44 +1000)]
doc: fix typos in go1.5.html

Thanks to Nathan Youngman for spotting them.

Change-Id: I1856527af66a5d1965265ec3dcd639d3f6d74bcc
Reviewed-on: https://go-review.googlesource.com/13711
Reviewed-by: Russ Cox <rsc@golang.org>
9 years agodoc/go1.5.html: refer to ppc64 as 64-bit PowerPC, not Power 64
Russ Cox [Tue, 18 Aug 2015 01:32:40 +0000 (21:32 -0400)]
doc/go1.5.html: refer to ppc64 as 64-bit PowerPC, not Power 64

Saying "Power 64" was wrong for reasons I don't remember.
(Those reasons are why we stopped using GOARCH=power64.)

Change-Id: Ifaac78d5733bfc780df01b1a66da766af0b17726
Reviewed-on: https://go-review.googlesource.com/13675
Reviewed-by: Rob Pike <r@golang.org>
9 years agodoc: adjust binary install page supported system list
Russ Cox [Tue, 18 Aug 2015 15:15:15 +0000 (11:15 -0400)]
doc: adjust binary install page supported system list

Make clear that this list is the list of supported systems
for binary distributions, and that other systems may be
able to build the distribution from source, in addition
to using gccgo.

Drop freebsd/arm from the list on this page.
We have never issued a binary distribution for freebsd/arm,
and we're not going to start in Go 1.5, since we don't even
have a working builder for it.

Drop freebsd/386 from the list on the page,
because we are unable to build binary distributions, per adg.

I think the wording here should probably be revised further,
but not now.

Change-Id: Ib43b6b64f5c438bfb9aa4d3daa43393f1e33b71f
Reviewed-on: https://go-review.googlesource.com/13690
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: implement OHMUL
Todd Neal [Wed, 19 Aug 2015 00:14:47 +0000 (19:14 -0500)]
[dev.ssa] cmd/compile/internal/ssa: implement OHMUL

Adds support for high multiply which is used by the frontend when
rewriting const division.  The frontend currently only does this for 8,
16, and 32 bit integer arithmetic.

Change-Id: I9b6c6018f3be827a50ee6c185454ebc79b3094c8
Reviewed-on: https://go-review.googlesource.com/13696
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: implement ODIV
Todd Neal [Mon, 17 Aug 2015 22:46:06 +0000 (17:46 -0500)]
[dev.ssa] cmd/compile/internal/ssa: implement ODIV

Implement integer division for non-consts.

Change-Id: If40cbde20e5f0ebb9993064def7be468e4eca076
Reviewed-on: https://go-review.googlesource.com/13644
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: fix string store rewrite
Keith Randall [Tue, 18 Aug 2015 17:28:58 +0000 (10:28 -0700)]
[dev.ssa] cmd/compile: fix string store rewrite

Store ops now need their size in the auxint field.  I missed this one.

Change-Id: I050fd6b5b00579883731702c426edafa3a5f7561
Reviewed-on: https://go-review.googlesource.com/13682
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years agocmd/vet: power64 is now ppc64
Russ Cox [Tue, 18 Aug 2015 13:58:24 +0000 (09:58 -0400)]
cmd/vet: power64 is now ppc64

This was missed when we did the rename months ago
because cmd/vet did not live in the main tree.
Now vet's asmdecl checks will apply to ppc64 assembly too.

Change-Id: I687cba89fef702f29dd118de76a7ca1041c414f6
Reviewed-on: https://go-review.googlesource.com/13677
Reviewed-by: Andrew Gerrand <adg@golang.org>