]> Cypherpunks repositories - gostls13.git/log
gostls13.git
9 years ago[dev.ssa] cmd/compile: Use varkill only for non-SSAable vars
Keith Randall [Sat, 19 Sep 2015 19:01:39 +0000 (12:01 -0700)]
[dev.ssa] cmd/compile: Use varkill only for non-SSAable vars

For variables which get SSA'd, SSA keeps track of all the def/kill.
It is only for on-stack variables that we need them.

This reduces stack frame sizes significantly because often the
only use of a variable was a varkill, and without that last use
the variable doesn't get allocated in the frame at all.

Fixes #12602

Change-Id: I3f00a768aa5ddd8d7772f375b25f846086a3e689
Reviewed-on: https://go-review.googlesource.com/14758
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile: move un-SSAable objects
Keith Randall [Sat, 19 Sep 2015 05:58:10 +0000 (22:58 -0700)]
[dev.ssa] cmd/compile: move un-SSAable objects

We need to move any objects whose types are not SSA-able.

Fixes the "not lowered: Load ARRAY PTR64 mem" errors.

Change-Id: I7a0b609f917d7fb34bc9215fee4da15f9961cf6c
Reviewed-on: https://go-review.googlesource.com/14753
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years ago[dev.ssa] cmd/compile: implement OSTRUCTLIT and OARRAYLIT
Keith Randall [Sat, 19 Sep 2015 05:12:38 +0000 (22:12 -0700)]
[dev.ssa] cmd/compile: implement OSTRUCTLIT and OARRAYLIT

The frontend rewrites most literals, so we see only zero
ones during SSA construction.  We can implement those
using the existing zeroing behavior.

Change-Id: I390ad1be0a4b6729baf0c8936c7610aae2aef049
Reviewed-on: https://go-review.googlesource.com/14754
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years ago[dev.ssa] cmd/compile: consistent naming of temporary vars
Keith Randall [Thu, 17 Sep 2015 23:45:10 +0000 (16:45 -0700)]
[dev.ssa] cmd/compile: consistent naming of temporary vars

ptrvar -> ptrVar, etc.

Change-Id: Id38bed0e145711dfe3bdc9541ab4741da6a570a2
Reviewed-on: https://go-review.googlesource.com/14725
Reviewed-by: Todd Neal <todd@tneal.org>
9 years ago[dev.ssa] cmd/compile: implement ODOTTYPE and OAS2DOTTYPE
Keith Randall [Thu, 17 Sep 2015 17:31:16 +0000 (10:31 -0700)]
[dev.ssa] cmd/compile: implement ODOTTYPE and OAS2DOTTYPE

Taken over and completed from Josh's change
https://go-review.googlesource.com/#/c/14524/

Change-Id: If5d4f732843cc3e99bd5edda54458f0a8be73e91
Reviewed-on: https://go-review.googlesource.com/14690
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: Generate AUNDEF at the end of BlockExit blocks
Keith Randall [Thu, 17 Sep 2015 22:19:23 +0000 (15:19 -0700)]
[dev.ssa] cmd/compile: Generate AUNDEF at the end of BlockExit blocks

Generate AUNDEF for every exit block, not just for certain
control values.

Change-Id: Ife500ac5159ee790bc1e70c0e9b0b1f854bc4c47
Reviewed-on: https://go-review.googlesource.com/14721
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile/internal/ssa: complete call ops
Keith Randall [Thu, 10 Sep 2015 06:56:59 +0000 (23:56 -0700)]
[dev.ssa] cmd/compile/internal/ssa: complete call ops

OCALLINTER, as well as ODEFER/OPROC with OCALLMETH/OCALLINTER.

Move all the call logic to its own routine, a lot of the
code is shared.

Change-Id: Ieac59596165e434cc6d1d7b5e46b78957e9c5ed3
Reviewed-on: https://go-review.googlesource.com/14464
Reviewed-by: Todd Neal <todd@tneal.org>
Reviewed-by: David Chase <drchase@google.com>
9 years ago[dev.ssa] cmd/compile/internal/ssa: fix iface and slice comparisons
Keith Randall [Thu, 10 Sep 2015 20:53:27 +0000 (13:53 -0700)]
[dev.ssa] cmd/compile/internal/ssa: fix iface and slice comparisons

A simpler way to do iface/slice comparisons.  Fixes some
cases of failed lowerings.

Change-Id: Ia252bc8648293a2d460f63c41f1591785543a1e9
Reviewed-on: https://go-review.googlesource.com/14493
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile/internal/gc: implement OAPPEND
Keith Randall [Fri, 11 Sep 2015 18:02:57 +0000 (11:02 -0700)]
[dev.ssa] cmd/compile/internal/gc: implement OAPPEND

Change-Id: I1fbce8c421c48074a964b4d9481c92fbc3524f80
Reviewed-on: https://go-review.googlesource.com/14525
Reviewed-by: Todd Neal <todd@tneal.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: turn off runtime ssa tests
Keith Randall [Tue, 15 Sep 2015 22:39:47 +0000 (15:39 -0700)]
[dev.ssa] cmd/compile/internal/ssa: turn off runtime ssa tests

Fixes build.  Not great, but it will let others make progress.

Change-Id: If9cf2bbb5016e40aa91cf1c8bb62982ae2aed5e4
Reviewed-on: https://go-review.googlesource.com/14621
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: fix sign extension + load combo
Keith Randall [Tue, 15 Sep 2015 16:02:07 +0000 (09:02 -0700)]
[dev.ssa] cmd/compile/internal/ssa: fix sign extension + load combo

Load-and-sign-extend opcodes were being generated in the
wrong block, leading to having more than one memory variable
live at once.  Fix the rules + add a test.

Change-Id: Iadf80e55ea901549c15c628ae295c2d0f1f64525
Reviewed-on: https://go-review.googlesource.com/14591
Reviewed-by: Todd Neal <todd@tneal.org>
Run-TryBot: Todd Neal <todd@tneal.org>

9 years ago[dev.ssa] cmd/compile/internal/ssa: implement write barriers
Keith Randall [Tue, 8 Sep 2015 06:18:02 +0000 (23:18 -0700)]
[dev.ssa] cmd/compile/internal/ssa: implement write barriers

For now, we only use typedmemmove.  This can be optimized
in future CLs.

Also add a feature to help with binary searching bad compilations.
Together with GOSSAPKG, GOSSAHASH specifies the last few binary digits
of the hash of function names that should be compiled.  So
GOSSAHASH=0110 means compile only those functions whose last 4 bits
of hash are 0110.  By adding digits to the front we can binary search
for the function whose SSA-generated code is causing a test to fail.

Change-Id: I5a8b6b70c6f034f59e5753965234cd42ea36d524
Reviewed-on: https://go-review.googlesource.com/14530
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: implement slice opcodes
Keith Randall [Sun, 13 Sep 2015 06:27:26 +0000 (23:27 -0700)]
[dev.ssa] cmd/compile/internal/ssa: implement slice opcodes

Implement OSLICE, OSLICEARR, OSLICESTR, OSLICE3, OSLICE3ARR.

reviewer: Ignore the code in OINDEX, that's from CL 14466.

Change-Id: I00cc8aecd4c6f40ea5517cd660bb0ce759d91171
Reviewed-on: https://go-review.googlesource.com/14538
Reviewed-by: Todd Neal <todd@tneal.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: fix string index
Keith Randall [Thu, 10 Sep 2015 17:01:15 +0000 (10:01 -0700)]
[dev.ssa] cmd/compile/internal/ssa: fix string index

Change-Id: I984d3e0410ac38c4e42ae8e3670ea47e2140de76
Reviewed-on: https://go-review.googlesource.com/14466
Reviewed-by: Alexandru Moșoi <alexandru@mosoi.ro>
Reviewed-by: Todd Neal <todd@tneal.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: don't treat vardef/varkill as reads
Keith Randall [Sat, 12 Sep 2015 21:45:58 +0000 (14:45 -0700)]
[dev.ssa] cmd/compile/internal/ssa: don't treat vardef/varkill as reads

This makes deadstore elimination work reasonably again.

Change-Id: I3a8caced71f12dfb6c1d0c68b7a7d8d7a736ea23
Reviewed-on: https://go-review.googlesource.com/14536
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: OCHECKNIL is a statement, not an expression
Keith Randall [Sat, 12 Sep 2015 21:06:44 +0000 (14:06 -0700)]
[dev.ssa] cmd/compile/internal/ssa: OCHECKNIL is a statement, not an expression

Change-Id: I5a683f532a5a0b2bc862d80c871e8dc6721016fc
Reviewed-on: https://go-review.googlesource.com/14534
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: implement OCOMPLEX
Keith Randall [Sat, 12 Sep 2015 21:14:02 +0000 (14:14 -0700)]
[dev.ssa] cmd/compile/internal/ssa: implement OCOMPLEX

Change-Id: I1e5993e0e56481ce838c0e3979b1a3052e72dba5
Reviewed-on: https://go-review.googlesource.com/14535
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: implement OSQRT
Keith Randall [Sat, 12 Sep 2015 20:26:57 +0000 (13:26 -0700)]
[dev.ssa] cmd/compile/internal/ssa: implement OSQRT

Change-Id: Iec61ca1bdc064c29ceca6d47f600d5643d0a64dd
Reviewed-on: https://go-review.googlesource.com/14533
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile: refactor assign
Josh Bleecher Snyder [Sat, 29 Aug 2015 21:54:45 +0000 (14:54 -0700)]
[dev.ssa] cmd/compile: refactor assign

Move the AST to SSA conversion to the caller.
This enables it to be used in contexts in which
the RHS is already an *ssa.Value.

Change-Id: Ibb87210fb9fda095a9b7c7f4ad1264a7cbd269bf
Reviewed-on: https://go-review.googlesource.com/14521
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: minor CSE cleanup
Josh Bleecher Snyder [Fri, 11 Sep 2015 17:28:33 +0000 (10:28 -0700)]
[dev.ssa] cmd/compile: minor CSE cleanup

Remove unnecessary local var split.

Change-Id: I907ef682b5fd9b3a67771edd1fe90c558f8937ea
Reviewed-on: https://go-review.googlesource.com/14523
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: add constBool helpers
Josh Bleecher Snyder [Tue, 8 Sep 2015 23:52:25 +0000 (16:52 -0700)]
[dev.ssa] cmd/compile: add constBool helpers

Change-Id: I1f93ea65bbdc895cd4eff7545e1688a64d85aae5
Reviewed-on: https://go-review.googlesource.com/14520
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: simplify how exit blocks are used
Keith Randall [Thu, 10 Sep 2015 01:03:41 +0000 (18:03 -0700)]
[dev.ssa] cmd/compile/internal/ssa: simplify how exit blocks are used

Move to implicit (mostly) instead of explicit exit blocks.
RET and RETJMP have no outgoing edges - they implicitly exit.
CALL only has one outgoing edge, as its exception edge is
implicit as well.
Exit blocks are only used for unconditionally panicking code,
like the failed branches of nil and bounds checks.

There may now be more than one exit block.  No merges happen
at exit blocks.

The only downside is it is harder to find all the places code
can exit the method.  See the reverse dominator code for an
example.

Change-Id: I42e2fd809a4bf81301ab993e29ad9f203ce48eb0
Reviewed-on: https://go-review.googlesource.com/14462
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile/internal/ssa: fix complex compares
Keith Randall [Thu, 10 Sep 2015 21:59:00 +0000 (14:59 -0700)]
[dev.ssa] cmd/compile/internal/ssa: fix complex compares

It was using 64-bit float comparison ops for complex64.
It should use 32-bit float comparison.

Fixes build.

Change-Id: I6452b227257fecc09e04cd092ccf328d1fc9917f
Reviewed-on: https://go-review.googlesource.com/14497
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: add == and != for complex
Keith Randall [Thu, 10 Sep 2015 18:05:42 +0000 (11:05 -0700)]
[dev.ssa] cmd/compile/internal/ssa: add == and != for complex

Change-Id: Iefabce4eb0dbc313dd1863513b45307cc76c545a
Reviewed-on: https://go-review.googlesource.com/14468
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: fix real/imag ops
Keith Randall [Thu, 10 Sep 2015 18:37:09 +0000 (11:37 -0700)]
[dev.ssa] cmd/compile/internal/ssa: fix real/imag ops

They were using the result type to look up the op, not the arg type.

Change-Id: I0641cba363fa6e7a66ad0860aa340106c10c2cea
Reviewed-on: https://go-review.googlesource.com/14469
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] test: fix build
Todd Neal [Thu, 10 Sep 2015 00:39:31 +0000 (20:39 -0400)]
[dev.ssa] test: fix build

Add line that was inadvertently removed.

Change-Id: I99ebc1041e984e408ae5825836c28b9891d6043b
Reviewed-on: https://go-review.googlesource.com/14470
Run-TryBot: Todd Neal <todd@tneal.org>
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: implement OCFUNC
Todd Neal [Tue, 8 Sep 2015 00:07:02 +0000 (19:07 -0500)]
[dev.ssa] cmd/compile/internal/ssa: implement OCFUNC

Change-Id: Ieb9cddf8876bf8cd5ee1705d9210d22c3959e8cc
Reviewed-on: https://go-review.googlesource.com/14329
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Todd Neal <todd@tneal.org>

9 years ago[dev.ssa] cmd/compile/internal/ssa: treat -0.0 literal as 0.0
Todd Neal [Tue, 8 Sep 2015 11:50:25 +0000 (07:50 -0400)]
[dev.ssa] cmd/compile/internal/ssa: treat -0.0 literal as 0.0

This matches existing behavior, see issue #2196

Change-Id: Ifa9359b7c821115389f337a57de355c5ec23be8f
Reviewed-on: https://go-review.googlesource.com/14261
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: fix N^2 dominator queries in CSE
David Chase [Mon, 7 Sep 2015 01:32:24 +0000 (21:32 -0400)]
[dev.ssa] cmd/compile: fix N^2 dominator queries in CSE

Added tree numbering data structure.
Changed dominator query in CSE.
Removed skip-for-too-big patch in CSE.
Passes all.bash.

Change-Id: I98d7c61b6015c81f5edab553615db17bc7a58d68
Reviewed-on: https://go-review.googlesource.com/14326
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: implement ORETJMP
Keith Randall [Wed, 9 Sep 2015 04:28:44 +0000 (21:28 -0700)]
[dev.ssa] cmd/compile/internal/ssa: implement ORETJMP

Change-Id: I352c7b9aab053959bc74c15861339e1dbe545ddc
Reviewed-on: https://go-review.googlesource.com/14404
Reviewed-by: David Chase <drchase@google.com>
9 years ago[dev.ssa] cmd/compile/internal/ssa: eval defer args before setting argsize and func
Keith Randall [Wed, 9 Sep 2015 04:37:37 +0000 (21:37 -0700)]
[dev.ssa] cmd/compile/internal/ssa: eval defer args before setting argsize and func

Evaluating args can overwrite arg area, so we can't write argsize and func
until args are evaluated.

Fixes test/recover.go, test/recover1.go, and test/fixedbugs/issue4066.go

Change-Id: I862e4934ccdb8661431bcc3e1e93817ea834ea3f
Reviewed-on: https://go-review.googlesource.com/14405
Reviewed-by: David Chase <drchase@google.com>
9 years ago[dev.ssa] cmd/compile/internal/ssa: handle returns correctly
Keith Randall [Tue, 8 Sep 2015 23:04:37 +0000 (16:04 -0700)]
[dev.ssa] cmd/compile/internal/ssa: handle returns correctly

Make sure that return blocks take a store as their control.  Without
this, code was getting inserted between the return and exit blocks.

Use AEND to mark the end of code.  The live variable analysis gets
confused when routines end like:
    JMP earlier
    RET
because the RET is unreachable.  The RET was incorrectly added to the
last basic block, rendering the JMP invisible to the CFG builder.

Change-Id: I91b32c8b37075347243ff039b4e4385856fba7cd
Reviewed-on: https://go-review.googlesource.com/14398
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile/internal/gc: avoid generating test binary file
Keith Randall [Tue, 8 Sep 2015 23:23:50 +0000 (16:23 -0700)]
[dev.ssa] cmd/compile/internal/gc: avoid generating test binary file

Using the main package causes a binary to be generated.  That binary
clutters up git listings.

Use a non-main package instead, so the results of a successful
compilation are thrown away.

Change-Id: I3ac91fd69ad297a5c0fe035c22fdef290b7dfbc4
Reviewed-on: https://go-review.googlesource.com/14399
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years ago[dev.ssa] Merge remote-tracking branch 'origin/master' into mergebranch
Keith Randall [Tue, 8 Sep 2015 22:42:53 +0000 (15:42 -0700)]
[dev.ssa] Merge remote-tracking branch 'origin/master' into mergebranch

Semi-regular merge of master into dev.ssa.

Change-Id: I48aa17700096a14f2a20ad07491ebfcd7529f6d5

9 years agocmd/compile/internal/mips64: copy cmd/compile/internal/ppc64
Shenghou Ma [Sun, 6 Sep 2015 00:32:40 +0000 (20:32 -0400)]
cmd/compile/internal/mips64: copy cmd/compile/internal/ppc64

Just a mechanical copy, no code changes.
This is to reduce code difference when adding the mips64 port.

Change-Id: Id06e975f414a7b09f4827167b30813b228a3bfaf
Reviewed-on: https://go-review.googlesource.com/14324
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/internal/obj/mips: copy cmd/internal/obj/ppc64
Shenghou Ma [Sun, 6 Sep 2015 00:27:00 +0000 (20:27 -0400)]
cmd/internal/obj/mips: copy cmd/internal/obj/ppc64

Just a mechanical copy with filename renames, no code changes.
This is to reduce code difference when adding the mips64 port.

Change-Id: Id06e975f414a7b09f4827167b30813b228a3bfae
Reviewed-on: https://go-review.googlesource.com/14323
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/internal/obj: remove dead code and small cleanups
Michael Hudson-Doyle [Mon, 7 Sep 2015 03:00:52 +0000 (15:00 +1200)]
cmd/internal/obj: remove dead code and small cleanups

Change-Id: I88fa0cc245a2141af04acced8716e08b1133abd1
Reviewed-on: https://go-review.googlesource.com/14350
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoAUTHORS: add Oracle as corporate copyright holder
Brad Fitzpatrick [Tue, 8 Sep 2015 17:28:22 +0000 (10:28 -0700)]
AUTHORS: add Oracle as corporate copyright holder

Some commits made by Aram from his personal email address are
actually copyright Oracle:

a77fcb3 net: fix comment in sendFile
b0e71f4 net: link with networking libraries when net package is in use
92e959a syscall, net: use sendfile on Solaris
db8d5b7 net: try to fix setKeepAlivePeriod on Solaris
fe5ef5c runtime, syscall: link Solaris binaries directly instead of using dlopen/dlsym
2b90c3e go/build: enable cgo by default on solaris/amd64
2d18ab7 doc/progs: disable cgo tests that use C.Stdout on Solaris
2230e9d misc/cgo: add various solaris build lines
649c7b6 net: add cgo support for Solaris
24396da os/user: small fixes for Solaris
121489c runtime/cgo: add cgo support for solaris/amd64
83b25d9 cmd/ld: make .rela and .rela.plt sections contiguous
c94f1f7 runtime: always load address of libcFunc on Solaris
e481aac cmd/6l: use .plt instead of .got on Solaris

See bug for clarification.

Fixes #12452

Change-Id: I0aeb1b46c0c7d09c5c736e383ecf40240d2cf85f
Reviewed-on: https://go-review.googlesource.com/14380
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: fix string slice types.
Alexandru Moșoi [Tue, 8 Sep 2015 16:18:59 +0000 (18:18 +0200)]
[dev.ssa] cmd/compile/internal/ssa: fix string slice types.

Change-Id: I28bc6373bb42d9abf4f179664dbaab8d514a6ab9
Reviewed-on: https://go-review.googlesource.com/14376
Reviewed-by: Keith Randall <khr@golang.org>
9 years agodoc: mention that go install removes binaries built by go build
Rob Pike [Tue, 8 Sep 2015 17:58:21 +0000 (10:58 -0700)]
doc: mention that go install removes binaries built by go build

Fixes #12288.

For inclusion in the 1.5.1 release.

Change-Id: I9354b7eaa76000498465c4a5cbab7246de9ecb7c
Reviewed-on: https://go-review.googlesource.com/14382
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: fix defer in functions with no return
Keith Randall [Tue, 8 Sep 2015 15:59:57 +0000 (08:59 -0700)]
[dev.ssa] cmd/compile/internal/ssa: fix defer in functions with no return

The after-defer test jumps to a deferreturn site.  Some functions
(those with infinite loops) have no deferreturn site.  Add one
so we have one to jump to.

Change-Id: I505e7f3f888f5e7d03ca49a3477b41cf1f78eb8a
Reviewed-on: https://go-review.googlesource.com/14349
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years agodoc: strconv.QuoteToGraphic in go1.6.txt
Rob Pike [Tue, 8 Sep 2015 17:39:03 +0000 (10:39 -0700)]
doc: strconv.QuoteToGraphic in go1.6.txt

Change-Id: I2f05d0b62deb5d7d0886f6fc5af5e7b79792efba
Reviewed-on: https://go-review.googlesource.com/14381
Reviewed-by: Rob Pike <r@golang.org>
9 years agostrconv: add QuoteToGraphic and friends
Rob Pike [Wed, 2 Sep 2015 22:08:24 +0000 (15:08 -0700)]
strconv: add QuoteToGraphic and friends

This version of quoting allows runes in category Zs, such as the
ideographic space characters, to be passed through unquoted.

Still to do (maybe): A way to access this from Printf.

Updates #11511.

Change-Id: I3bae84b1aa0bc1b885318d3f67c5f451099a2a5a
Reviewed-on: https://go-review.googlesource.com/14184
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
9 years agocmd/compile/internal/gc: convert fields of Type to bool
Marvin Stenger [Tue, 8 Sep 2015 01:51:30 +0000 (03:51 +0200)]
cmd/compile/internal/gc: convert fields of Type to bool

Convert some fields of struct Type in go.go from uint8 to bool.

This change passes go build -toolexec 'toolstash -cmp' -a std.

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

9 years agocmd/compile/internal/gc: convert fields of Pkg to bool
Marvin Stenger [Tue, 8 Sep 2015 03:46:31 +0000 (05:46 +0200)]
cmd/compile/internal/gc: convert fields of Pkg to bool

Convert Pkg.Imported, Pkg.Exported, Pkg.Direct from uint8/int8/int8 to bool.

This change passes go build -toolexec 'toolstash -cmp' -a std.

Change-Id: I67a71f1186ff9737c03eca413f7d35d8a79ebc9b
Reviewed-on: https://go-review.googlesource.com/14371
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] test: ensure that all current tests run
Todd Neal [Tue, 8 Sep 2015 00:29:26 +0000 (19:29 -0500)]
[dev.ssa] test: ensure that all current tests run

Some of the test files were missing, so add them.

Change-Id: Ifac248edf33e1e4ccd82355f596d74eab4ff01a2
Reviewed-on: https://go-review.googlesource.com/14328
Run-TryBot: Todd Neal <todd@tneal.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years agocmd/compile/internal/gc: unexport and make Hasdefer a bool
Håvard Haugen [Mon, 7 Sep 2015 20:19:30 +0000 (22:19 +0200)]
cmd/compile/internal/gc: unexport and make Hasdefer a bool

Passes go build -a -toolexec 'toolstash -cmp' std cmd.

Change-Id: I804ee4252fa9be78cb277faf7f467e6c9cfdd4a6
Reviewed-on: https://go-review.googlesource.com/14319
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/compile/internal/gc: remove unused field Type.Siggen
Marvin Stenger [Tue, 8 Sep 2015 03:54:22 +0000 (05:54 +0200)]
cmd/compile/internal/gc: remove unused field Type.Siggen

Remove unused field Type.Siggen in go.go.

This change passes go build -toolexec 'toolstash -cmp' -a std.

Change-Id: Ia61fe65a226c913fbf4a11a71d7453c56aa46c0e
Reviewed-on: https://go-review.googlesource.com/14372
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
9 years agocmd/compile: make importlist a []*Node instead of *NodeList
Håvard Haugen [Sun, 6 Sep 2015 20:38:49 +0000 (22:38 +0200)]
cmd/compile: make importlist a []*Node instead of *NodeList

Passes go build -a -toolexec 'toolstash -cmp' std.

Change-Id: Ica62765d3c1ef052afed34da1b3ac3f80646cc55
Reviewed-on: https://go-review.googlesource.com/14318
Reviewed-by: Dave Cheney <dave@cheney.net>
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/compile/internal/gc: convert Type.Broke into a bool
Dave Cheney [Mon, 7 Sep 2015 00:37:26 +0000 (10:37 +1000)]
cmd/compile/internal/gc: convert Type.Broke into a bool

Convert Type.Broke from a uint8 to a boolean

This change passes go build -toolexec 'toolstash -cmp' -a std.

Change-Id: I44e7548c71b00467e36576bdf62933c42555a21a
Reviewed-on: https://go-review.googlesource.com/14307
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Håvard Haugen <havard.haugen@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agocmd/compile/internal/gc: convert Label.Used to bool
Dave Cheney [Mon, 7 Sep 2015 01:11:14 +0000 (11:11 +1000)]
cmd/compile/internal/gc: convert Label.Used to bool

Convert Label.Used to a boolean. Also move the field to the
bottom of the struct to avoid padding.

This change passes go build -toolexec 'toolstash -cmp' -a std.

Change-Id: If09ee92f9d54dce807e7b862cf771005daed810d
Reviewed-on: https://go-review.googlesource.com/14308
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/ssa: large object load/store vs. vardef
Keith Randall [Mon, 7 Sep 2015 20:55:49 +0000 (13:55 -0700)]
[dev.ssa] cmd/compile/internal/ssa: large object load/store vs. vardef

VarDef declarations are getting in the way of rewriting load/store
pairs into moves.  This change fixes that, albeit in a really hacky way.
Better options would be appreciated.

Increases coverage during make.bash from 67% to 71%.

Change-Id: I336e967687e2238c7d0d64e3b37132a731ad15c3
Reviewed-on: https://go-review.googlesource.com/14347
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years agoruntime: remove unused FUNCDATA_DeadValueMaps
Michael Hudson-Doyle [Mon, 7 Sep 2015 03:36:56 +0000 (15:36 +1200)]
runtime: remove unused FUNCDATA_DeadValueMaps

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

9 years ago[dev.ssa] cmd/compile: clean up nilcheck logic
Todd Neal [Sun, 6 Sep 2015 20:00:01 +0000 (16:00 -0400)]
[dev.ssa] cmd/compile: clean up nilcheck logic

Be more clear about the two conditions that we care about:
1) a block that performs a nil check (OpIsNonNil), which may be removed
2) a block that is the non-nil sucessor for an OpIsNonNil block

Now we only care about removing nilchecks for two scenarios:
- a type 1 block is dominated by a type 2 block for the same value
- a block is both type 1 and type 2 for the same value

Fixes math/big.

Change-Id: I50018a4014830461ddfe2a2daf588468e4a8f0b4
Reviewed-on: https://go-review.googlesource.com/14325
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] test: use SSA codegen for runnable tests
Josh Bleecher Snyder [Mon, 7 Sep 2015 02:39:07 +0000 (19:39 -0700)]
[dev.ssa] test: use SSA codegen for runnable tests

Now that the standard library tests
are all passing, add the
test directory tests.

These contain a number of edge case tests
that are of particular interest for compilers.

Some kinds of tests are not well-suited
for a new backend, such as errorcheck tests.
To start, use SSA only for run and runoutput.

There are three failing tests now.
Just mark them as such for now,
so that we can prevent regressions.

This code will all be unwound once SSA
codegen matures and becomes the default.

Change-Id: Ic51e6d0cc1cd48ef1e2fe2c9a743bf0cce275200
Reviewed-on: https://go-review.googlesource.com/14344
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years ago[dev.ssa] cmd/compile: update SSA todos
Josh Bleecher Snyder [Mon, 7 Sep 2015 16:03:58 +0000 (09:03 -0700)]
[dev.ssa] cmd/compile: update SSA todos

Change-Id: I1271c015e602cd7ec92bf24f019dd8839b3180fc
Reviewed-on: https://go-review.googlesource.com/14346
Reviewed-by: Keith Randall <khr@golang.org>
9 years agocmd/compile/internal: some janitoring
Marvin Stenger [Sun, 6 Sep 2015 14:59:57 +0000 (16:59 +0200)]
cmd/compile/internal: some janitoring

Nicer swaps, loops (removed tmp variables). Use of bool instead of int.

This change passes go build -toolexec 'toolstash -cmp' -a std.

Change-Id: I541904c74b57297848decc51a8a4913a8eca4af3
Reviewed-on: https://go-review.googlesource.com/14316
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile: implement OIMAG and OREAL
Josh Bleecher Snyder [Mon, 7 Sep 2015 02:24:59 +0000 (19:24 -0700)]
[dev.ssa] cmd/compile: implement OIMAG and OREAL

Change-Id: I17c83f6552367d42d48c1ec62fbb494f010fd866
Reviewed-on: https://go-review.googlesource.com/14343
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agoruntime: add stub sigreturn on arm
Michael Hudson-Doyle [Wed, 2 Sep 2015 09:52:19 +0000 (21:52 +1200)]
runtime: add stub sigreturn on arm

When building a shared library, all functions that are declared must actually
be defined.

Change-Id: I1488690cecfb66e62d9fdb3b8d257a4dc31d202a
Reviewed-on: https://go-review.googlesource.com/14187
Reviewed-by: Dave Cheney <dave@cheney.net>
9 years agocmd/dist: fix mkzversion to produce gofmt'd output
Dave Cheney [Mon, 7 Sep 2015 06:04:01 +0000 (16:04 +1000)]
cmd/dist: fix mkzversion to produce gofmt'd output

Fix mkzversion to produce correctly formatted runtime/zversion.go.

Change-Id: Ie6bcd361a2f2e390b7f6c4980fcae2c41bb7e52f
Reviewed-on: https://go-review.googlesource.com/14355
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years ago[dev.ssa] cmd/compile: implement OEFACE
Josh Bleecher Snyder [Sun, 6 Sep 2015 02:28:27 +0000 (19:28 -0700)]
[dev.ssa] cmd/compile: implement OEFACE

Change-Id: I32953c4e1d82795bacba9eb94d65cd2e26bfeb87
Reviewed-on: https://go-review.googlesource.com/14339
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>

9 years ago[dev.ssa] cmd/compile: implement OCHECKNIL
Josh Bleecher Snyder [Sun, 6 Sep 2015 02:28:15 +0000 (19:28 -0700)]
[dev.ssa] cmd/compile: implement OCHECKNIL

Change-Id: Ifb6b2ad6078ad084b73c0e785e748e92139684e2
Reviewed-on: https://go-review.googlesource.com/14338
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years agocmd/compile: convert typecheck_stack to []*Node
Dave Cheney [Sat, 5 Sep 2015 04:43:50 +0000 (14:43 +1000)]
cmd/compile: convert typecheck_stack to []*Node

This one of a set of changes to make the transition away from NodeList
easier by removing cases in which NodeList doesn't act semi-trivially like a
[]*Node.

This CL was originally prepared by Josh Bleecher Snyder <josharian@gmail.com>.

This change passes go build -toolexec 'toolstash -cmp' -a std.

Change-Id: I4d041b343952f4a31f3150fd70669e08fcaa74f8
Reviewed-on: https://go-review.googlesource.com/14305
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/gc: handle local function declarations
Keith Randall [Sun, 6 Sep 2015 20:42:26 +0000 (13:42 -0700)]
[dev.ssa] cmd/compile/internal/gc: handle local function declarations

They are already handled by the frontend, we just need to
skip them when we see them in ssa.

Change-Id: I309d91552f96a761f8d429a2cab3a47d200ca9e5
Reviewed-on: https://go-review.googlesource.com/14341
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years ago[dev.ssa] cmd/compile: fix build
Josh Bleecher Snyder [Sun, 6 Sep 2015 22:04:46 +0000 (15:04 -0700)]
[dev.ssa] cmd/compile: fix build

CL 14337 made SSA support fixedbugs/issue9604b.go.
That test contains > 40k blocks.
This made the O(n^2) dom algorithm fail to terminate
in a reasonable length of time, breaking the build.

For the moment, cap the number of blocks
to fix the build.

This will be reverted when a more efficient
dom algorithm is put in place,
which will be soon.

Change-Id: Ia66c2629481d29d06655ec54d1deff076b0422c6
Reviewed-on: https://go-review.googlesource.com/14342
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: implement OPLUS
Josh Bleecher Snyder [Sun, 6 Sep 2015 02:28:00 +0000 (19:28 -0700)]
[dev.ssa] cmd/compile: implement OPLUS

Change-Id: Iaf282211a717e38b05e5d2661d400d465decad50
Reviewed-on: https://go-review.googlesource.com/14337
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile/internal/gc: implement go and defer
Keith Randall [Sat, 29 Aug 2015 05:51:01 +0000 (22:51 -0700)]
[dev.ssa] cmd/compile/internal/gc: implement go and defer

TODO: for now, just function calls.  Do method and interface calls.

Change-Id: Ib262dfa31cb753996cde899beaad4dc2e66705ac
Reviewed-on: https://go-review.googlesource.com/14035
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years ago[dev.ssa] cmd/compile: run std tests with SSA codegen as part of all.bash
Josh Bleecher Snyder [Fri, 4 Sep 2015 15:50:28 +0000 (08:50 -0700)]
[dev.ssa] cmd/compile: run std tests with SSA codegen as part of all.bash

Todd Neal has made all the stdlib tests pass.
Now the trybots and build dashboard can
help us keep them passing.

All of this code will be unwound bit by bit
as SSA matures and then becomes the default.

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

9 years agocmd/asm: fix another infinite loop in register list parser
Didier Spezia [Sat, 5 Sep 2015 11:28:33 +0000 (11:28 +0000)]
cmd/asm: fix another infinite loop in register list parser

The code parsing register lists involves an inner loop on
each range defined by the lo,hi bounds. The condition on
this loop (for lo<=hi) is fragile, because the bounds
are unsigned 16 bits numbers.

In some corner cases, the calculated upper bound is 2^16-1
leading to an infinite loop.

Parsing operand `[):[o-FP` results in:
- an infinite loop for non ARM architectures
- the generation of almost 2^16 errors for the ARM architecture
  (which are then ignored)

This CL improves the code in 3 ways:
- bail out early when parsing non R prefixed registers
- make sure the register index is never negative
- make sure the number of iterations is limited by the
  maximum size of the range (as a defensive measure).

Fixes #12469

Change-Id: Ib1e7e36fb8ad5a3a52c50fc6219d3cfe2b39cc34
Reviewed-on: https://go-review.googlesource.com/14314
Reviewed-by: Rob Pike <r@golang.org>
9 years ago[dev.ssa] cmd/runtime: generate gc bitmaps for SSA-compiled code
Keith Randall [Mon, 24 Aug 2015 09:16:19 +0000 (02:16 -0700)]
[dev.ssa] cmd/runtime: generate gc bitmaps for SSA-compiled code

This change is all about leveraging the gc bitmap generation
that is already done by the current compiler.  We rearrange how
stack allocation is done so that we generate a variable declaration
for each spill.  We also reorganize how args/locals are recorded
during SSA.  Then we can use the existing allocauto/defframe to
allocate the stack frame and liveness to make the gc bitmaps.

With this change, stack copying works correctly and we no longer
need hacks in runtime/stack*.go to make tests work.  GC is close
to working, it just needs write barriers.

Change-Id: I990fb4e3fbe98850c6be35c3185a1c85d9e1a6ba
Reviewed-on: https://go-review.googlesource.com/13894
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years agocmd/compile: use []*Node instead of NodeList in bottomUpVisitor
Dave Cheney [Sat, 5 Sep 2015 02:30:13 +0000 (12:30 +1000)]
cmd/compile: use []*Node instead of NodeList in bottomUpVisitor

This one of a set of changes to make the transition away from NodeList
easier by removing cases in which NodeList doesn't act semi-trivially like a
[]*Node.

This CL was originally prepared by Josh Bleecher Snyder <josharian@gmail.com>.

This change passes go build -toolexec 'toolstash -cmp' -a std.

Change-Id: I582ff8b077eb384b84721a1edb0c1efbc0c40059
Reviewed-on: https://go-review.googlesource.com/14304
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years ago[dev.ssa] cmd/compile: cleanup fp conversions in ssa.go
David Chase [Tue, 1 Sep 2015 21:09:00 +0000 (17:09 -0400)]
[dev.ssa] cmd/compile: cleanup fp conversions in ssa.go

Change to table-driven instead of branchy code; leads to
net reduction in lines, easier to understand what happens,
easier to modify code if we want option to exclude generation
of branchy cases.

Doesn't appear to scale for 8x8 case of integer types.

Change-Id: Ib40104b149d30bb329c5782f6cac45c75743e768
Reviewed-on: https://go-review.googlesource.com/14163
Reviewed-by: Keith Randall <khr@golang.org>
9 years agonet: Make Listen(":port") use IPv6 when IPv4 is not supported.
Paul Marks [Sat, 5 Sep 2015 01:33:35 +0000 (18:33 -0700)]
net: Make Listen(":port") use IPv6 when IPv4 is not supported.

When running an experimental kernel with IPv4 disabled, Listen(":port")
currently tries to create an AF_INET socket, and fails.  Instead, it
should see !supportsIPv4, and use an AF_INET6 socket.

This sort of environment is quite esoteric at the moment, but I can
force the tests to fail on regular Linux using the following tweaks:

- net/net.go: supportsIPv4, supportsIPv6, supportsIPv4map = false, true, false
- net/sockopt_linux.go: ipv6only=true
- net/ipsock_posix.go: Revert this fix
- ./make.bash && ../bin/go test net

Also, make the arrows in server_test.go point to the left, because
server<-client is easier to read.

Fixes #12510

Change-Id: I0cc3b6b08d5e6908d2fbf8594f652ba19815aa4b
Reviewed-on: https://go-review.googlesource.com/14334
Run-TryBot: Paul Marks <pmarks@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years ago[dev.ssa] cmd/compile: add allocs to pass stats
Josh Bleecher Snyder [Sat, 5 Sep 2015 00:33:56 +0000 (17:33 -0700)]
[dev.ssa] cmd/compile: add allocs to pass stats

Also, improve HTML formatting.

Change-Id: I07e2482a30862e2091707f260a2c43d6e9a85d97
Reviewed-on: https://go-review.googlesource.com/14333
Reviewed-by: Todd Neal <todd@tneal.org>
9 years ago[dev.ssa] cmd/compile: minor code cleanup
Josh Bleecher Snyder [Sat, 5 Sep 2015 00:33:32 +0000 (17:33 -0700)]
[dev.ssa] cmd/compile: minor code cleanup

Change-Id: I9c84f5ca18745fb2358494c6944bf7ddd05cf8f0
Reviewed-on: https://go-review.googlesource.com/14332
Reviewed-by: Todd Neal <todd@tneal.org>
9 years agocmd/compile: use []*Node instead of NodeList in sinit
Dave Cheney [Thu, 3 Sep 2015 07:07:00 +0000 (17:07 +1000)]
cmd/compile: use []*Node instead of NodeList in sinit

This is a first of a set of changes to make the transition away from NodeList
easier by removing cases in which NodeList doesn't act semi-trivially like a
[]*Node.

This CL was originally prepared by Josh Bleecher Snyder <josharian@gmail.com>.

This change passes go build -toolexec 'toolstash -cmp' -a std.

Change-Id: Iad10b75e42b5b24e1694407841282fa3bab2dc9f
Reviewed-on: https://go-review.googlesource.com/14232
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoreflect: record unsafe.Pointer, not uintptr, during DeepEqual
Russ Cox [Tue, 1 Sep 2015 03:41:27 +0000 (23:41 -0400)]
reflect: record unsafe.Pointer, not uintptr, during DeepEqual

This is more correct with respect to garbage collection.
I don't know of any specific failures it could cause today.

Change-Id: I7eed6a06d2f281051199e79e4a9913aa8360ded7
Reviewed-on: https://go-review.googlesource.com/14137
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years ago[dev.ssa] cmd/compile: rewrite user nil check as OpIsNonNil
Todd Neal [Mon, 31 Aug 2015 02:19:20 +0000 (21:19 -0500)]
[dev.ssa] cmd/compile: rewrite user nil check as OpIsNonNil

Rewite user nil checks as OpIsNonNil so our nil check elimination pass
can take advantage and remove redundant checks.

With make.bash this removes 10% more nilchecks (34110 vs 31088).

Change-Id: Ifb01d1b6d2d759f5e2a5aaa0470e1d5a2a680212
Reviewed-on: https://go-review.googlesource.com/14321
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
9 years agocmd/compile/internal/gc: fix go.y (rename of Fatal -> Fatalf)
Robert Griesemer [Fri, 4 Sep 2015 23:56:45 +0000 (16:56 -0700)]
cmd/compile/internal/gc: fix go.y (rename of Fatal -> Fatalf)

Also go generate to update generated files.

Change-Id: I049708db93455f0030ba5afc6f218fde6220958d
Reviewed-on: https://go-review.googlesource.com/14331
Reviewed-by: Damien Neil <dneil@google.com>
9 years ago[dev.ssa] cmd/compile: teach live variable analysis about LEAW
Keith Randall [Fri, 4 Sep 2015 20:16:07 +0000 (13:16 -0700)]
[dev.ssa] cmd/compile: teach live variable analysis about LEAW

SSA uses this opcode, the old compiler doesn't.

Change-Id: Ic3dde6216496b4b89d570584d34cb0971fdf379d
Reviewed-on: https://go-review.googlesource.com/14330
Reviewed-by: Minux Ma <minux@golang.org>
9 years agocmd/go: fix Go buildid reading on Solaris
Shawn Walker-Salas [Wed, 26 Aug 2015 22:24:41 +0000 (15:24 -0700)]
cmd/go: fix Go buildid reading on Solaris

TestNoteReading fails on Solaris with linkmode=external due to some
assumptions made about how ELF .note sections are written by some
linkers.

On current versions of Solaris and older derivatives, SHF_ALLOC is
intentionally ignored for .note sections unless the .note section is
assigned to the text segment via a mapfile.  Also, if .note sections
are assigned to the text segment, no PT_NOTE program header will be
created thwarting Go's attempts at attempting to quickly find the
.note.

Furthermore, Go assumes that the relevant note segment will be placed
early in the file while the Solaris linker currently places the note
segment last in the file, additionally thwarting Go's optimisation
attempts that read only the first 16KB of the file to find the
buildid.

The fix is to detect when the note section is outside of the first
16KB of the file and then fallback to additionally reading that
section of the file.  This way, in future versions of Solaris when
this linking behaviour is changed, the fast path will always succeed
and we'll only be slower if it fails; likewise, any other linker that
does this will also just work.

Fixes #12178

Change-Id: I61c1dc3f744ae3ad63938386d2ace8a432c0efe1
Reviewed-on: https://go-review.googlesource.com/14210
Run-TryBot: Aram Hăvărneanu <aram@mgk.ro>
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
9 years agoRevert "cmd/internal/ld: put read-only relocated data into .data.rel.ro when making...
Dave Cheney [Fri, 4 Sep 2015 09:53:35 +0000 (09:53 +0000)]
Revert "cmd/internal/ld: put read-only relocated data into .data.rel.ro when making a shared object"

This reverts commit 2c2cbb69c8dad1325f0a4b289417da73fd90f4b0.

Broke darwin/arm64

Change-Id: Ibd2dea475d6ce6a8b4b40e2da19a83fc0514025d
Reviewed-on: https://go-review.googlesource.com/14301
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agonet: make DNSError.Temporary return true on SERVFAIL
Dan Peterson [Wed, 2 Sep 2015 01:53:46 +0000 (22:53 -0300)]
net: make DNSError.Temporary return true on SERVFAIL

Fixes #8434

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

9 years agonet/http: optimize some io.Copy calls by reusing buffers
Artyom Pervukhin [Wed, 2 Sep 2015 22:19:51 +0000 (01:19 +0300)]
net/http: optimize some io.Copy calls by reusing buffers

Optimize two calls of io.Copy which cannot make use of neither
io.ReaderFrom nor io.WriterTo optimization tricks by replacing them with
io.CopyBuffer with reusable buffers.

First is fallback call to io.Copy when server misses the optimized case
of using sendfile to copy from a regular file to net.TCPConn; second is
use of io.Copy on piped reader/writer when handler implementation uses
http.CloseNotifier interface. One of the notable users of
http.CloseNotifier is httputil.ReverseProxy.

benchmark                    old ns/op     new ns/op     delta
BenchmarkCloseNotifier-4     309591        303388        -2.00%

benchmark                    old allocs     new allocs     delta
BenchmarkCloseNotifier-4     50             49             -2.00%

benchmark                    old bytes     new bytes     delta
BenchmarkCloseNotifier-4     36168         3140          -91.32%

Fixes #12455

Change-Id: I512e6aa2f1aeed2ed00246afb3350c819b65b87e
Reviewed-on: https://go-review.googlesource.com/14177
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agonet/http/httptest: ResponseRecorder.WriteString
Nodir Turakulov [Fri, 4 Sep 2015 17:05:31 +0000 (10:05 -0700)]
net/http/httptest: ResponseRecorder.WriteString

Fixes #11000

Change-Id: Ic137e8a6c5c6b5b7eee213aca9acf78368e1d686
Reviewed-on: https://go-review.googlesource.com/14296
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: slice/map literals janitoring
Didier Spezia [Sun, 23 Aug 2015 11:54:21 +0000 (11:54 +0000)]
cmd/compile/internal: slice/map literals janitoring

Simplify slice/map literal expressions.
Caught with gofmt -d -s, fixed with gofmt -w -s
Checked that the result can still be compiled with Go 1.4.

Change-Id: I5c58801c20919618d2ad52b8e2380d53df2783f1
Reviewed-on: https://go-review.googlesource.com/13831
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

9 years ago[dev.ssa] cmd/compile/ssa: add timing to compiler passes
Todd Neal [Tue, 11 Aug 2015 00:00:34 +0000 (19:00 -0500)]
[dev.ssa] cmd/compile/ssa: add timing to compiler passes

Add timing/allocation information to each compiler pass for both the
console and html output.

Change-Id: I75833003b806a09b4fb1bbf63983258612cdb7b0
Reviewed-on: https://go-review.googlesource.com/14277
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: store floats in AuxInt
Todd Neal [Fri, 4 Sep 2015 11:33:56 +0000 (06:33 -0500)]
[dev.ssa] cmd/compile: store floats in AuxInt

Store floats in AuxInt to reduce allocations.

Change-Id: I101e6322530b4a0b2ea3591593ad022c992e8df8
Reviewed-on: https://go-review.googlesource.com/14320
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
9 years ago[dev.ssa] cmd/compile: store bools in AuxInt
Todd Neal [Thu, 3 Sep 2015 23:24:22 +0000 (18:24 -0500)]
[dev.ssa] cmd/compile: store bools in AuxInt

Store bools in AuxInt to reduce allocations.

Change-Id: Ibd26db67fca5e1e2803f53d7ef094897968b704b
Reviewed-on: https://go-review.googlesource.com/14276
Reviewed-by: Keith Randall <khr@golang.org>
9 years agoimage/gif: map/slice literals janitoring
Didier Spezia [Sun, 23 Aug 2015 13:09:02 +0000 (13:09 +0000)]
image/gif: map/slice literals janitoring

Simplify slice/map literal expressions.
Caught with gofmt -d -s, fixed with gofmt -w -s

Change-Id: Iefd5f263c4f89a81da9427a7b9d97f13c35ab64f
Reviewed-on: https://go-review.googlesource.com/13838
Reviewed-by: Andrew Gerrand <adg@golang.org>
9 years agocmd/compile, cmd/go: generate position independent code with -buildmode=c-shared...
Michael Hudson-Doyle [Tue, 1 Sep 2015 02:03:38 +0000 (14:03 +1200)]
cmd/compile, cmd/go: generate position independent code with -buildmode=c-shared on arm

All the code was there to do this, it just wasn't hooked up.

Fixes #10914

Change-Id: Ide8f9bbe50fecb5d11cd579915ee98d4c7efe403
Reviewed-on: https://go-review.googlesource.com/14142
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agoruntime: teach softfloat interpreter about "add r11, pc, r11"
Michael Hudson-Doyle [Fri, 4 Sep 2015 02:57:59 +0000 (14:57 +1200)]
runtime: teach softfloat interpreter about "add r11, pc, r11"

This is generated during fp code when -shared is active.

Change-Id: Ia1092299b9c3b63ff771ca4842158b42c34bd008
Reviewed-on: https://go-review.googlesource.com/14286
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
9 years agocmd/link/internal/ld: align PE .text section to 32-byte when external linking
Shenghou Ma [Tue, 1 Sep 2015 23:58:31 +0000 (19:58 -0400)]
cmd/link/internal/ld: align PE .text section to 32-byte when external linking

Some symbols, for example, masks requires 16-byte alignment, and
they are placed in the text section. Before this change, the text
section is only aligned to 4-byte, and it's making masks unaligned.

Fixes #12415.

Change-Id: I7767778d1b4f7d3e74c2719a02848350782a4160
Reviewed-on: https://go-review.googlesource.com/14166
Run-TryBot: Minux Ma <minux@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/internal/ld: put read-only relocated data into .data.rel.ro when making a shared...
Michael Hudson-Doyle [Thu, 21 May 2015 01:07:19 +0000 (13:07 +1200)]
cmd/internal/ld: put read-only relocated data into .data.rel.ro when making a shared object

Currently Go produces shared libraries that cannot be shared between processes
because they have relocations against the text segment (not text section). This
fixes this by moving some data to sections with magic names recognized by the
static linker.

Fixes #10914
Updates #9210

Change-Id: I7178daadc0ae87953d5a084aa3d580f4e3b46d47
Reviewed-on: https://go-review.googlesource.com/10300
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/asm: fix handling of nested #if[n]defs
Michael Hudson-Doyle [Thu, 3 Sep 2015 10:49:18 +0000 (22:49 +1200)]
cmd/asm: fix handling of nested #if[n]defs

The lexer needs to process all #if[n]defs, even those found when processing is
disabled by a preceding failed conditional, or the first #endif in something
like:

    #ifdef <undefined>
    #ifdef whatever
    #endif
    #endif

terminates the first #ifdef and the second causes an error. And then the
processing of the inner #ifdefs needs to ignore their argument when they are
disabled by an outer failed condition.

Change-Id: Iba259498f1e16042f5b7580b9c000bb0599733d0
Reviewed-on: https://go-review.googlesource.com/14253
Reviewed-by: Rob Pike <r@golang.org>
9 years agointernal/syscall/windows/registry: do not panic when data is large
Alex Brainman [Fri, 4 Sep 2015 04:09:56 +0000 (14:09 +1000)]
internal/syscall/windows/registry: do not panic when data is large

Allow registry blobs to be as large as 500MB

Update #12493

Change-Id: I1d0e5c10772d25f8e7e17fed6e2e7dd12ca4e7cf
Reviewed-on: https://go-review.googlesource.com/14287
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
9 years agoall: remove executable bit from several files
Andrew Gerrand [Fri, 4 Sep 2015 01:34:36 +0000 (01:34 +0000)]
all: remove executable bit from several files

Change-Id: Iab669b2a9dd0510c0e54f9ec1cbe2b83b991bceb
Reviewed-on: https://go-review.googlesource.com/14283
Reviewed-by: Minux Ma <minux@golang.org>
9 years agocmd/link: only embed runtime.goarm in the module that contains the runtime package
Michael Hudson-Doyle [Wed, 2 Sep 2015 21:05:25 +0000 (09:05 +1200)]
cmd/link: only embed runtime.goarm in the module that contains the runtime package

And do it properly so freebsd and nacl still work.

Change-Id: I6f9f30e93ceae6dee59215ed608c6a158bdbdbb0
Reviewed-on: https://go-review.googlesource.com/14280
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agocmd/compile/internal/gc: allow //go:systemstack only in runtime
Shenghou Ma [Thu, 3 Sep 2015 21:39:20 +0000 (17:39 -0400)]
cmd/compile/internal/gc: allow //go:systemstack only in runtime

Fixes #12454.

Change-Id: I6406b0119bc4d6c3d1e6f1896b588b7d101448a3
Reviewed-on: https://go-review.googlesource.com/14274
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
9 years agohash: update documentation for MakeTable in crc32 and crc64
Joe Tsai [Thu, 3 Sep 2015 22:24:53 +0000 (15:24 -0700)]
hash: update documentation for MakeTable in crc32 and crc64

Explicitly say that *Table returned by MakeTable may not be
modified. Otherwise, this leads to very subtle bugs that may
or may not manifest themselves.

Same comment was made on package crc64, to keep the future
open to the caching tables that crc32 effectively does.

Fixes: #12487.
Change-Id: I2881bebb8b16f6f8564412172774c79c2593c6c1
Reviewed-on: https://go-review.googlesource.com/14258
Reviewed-by: Ian Lance Taylor <iant@golang.org>