1. 16 Sep, 2016 30 commits
  2. 15 Sep, 2016 10 commits
    • Alberto Bertogli's avatar
      net: document dummy byte in ReadMsgUnix and WriteMsgUnix · e727e370
      Alberto Bertogli authored
      ReadMsgUnix and WriteMsgUnix both will read/write 1 byte from/to the
      socket if they were given no buffer to read/write, to avoid a common
      pitfall in out of band operations (they will usually block
      indefinitely if there's no actual data to read).
      
      This patch adds a note about this behaviour in their documentation, so
      users can be aware of it.
      
      Change-Id: I751f0e12bb4d80311e94ea8de023595c5d40ec3e
      Reviewed-on: https://go-review.googlesource.com/29180
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      e727e370
    • David Chase's avatar
      cmd/compile: adapt GOSSAHASH to set a DebugTest flag in ssa.Config · 897c0ebf
      David Chase authored
      Binary search remains our friend.
      Suppose you add an ought-to-be-benign pattern to PPC64.rules,
      and make.bash starts crashing.  You can guard the pattern(s)
      with config.DebugTest:
      
      (Eq8 x y) && config.DebugTest && isSigned(x.Type) &&
         isSigned(y.Type) ->
         (Equal (CMPW (SignExt8to32 x) (SignExt8to32 y)))
      
      and then
      
        gossahash -s ./make.bash
        ...
        (go drink beer while silicon minions toil)
        ...
        Trying ./make.bash args=[], env=[GOSSAHASH=100110010111110]
        ./make.bash failed (1 distinct triggers): exit status 1
        Trigger string is 'GOSSAHASH triggered (*importReader).readByte',
          repeated 1 times
        Review GSHS_LAST_FAIL.0.log for failing run
        Finished with GOSSAHASH=100110010111110
      
      Change-Id: I4eff46ebaf496baa2acedd32e217005cb3ac1c62
      Reviewed-on: https://go-review.googlesource.com/29273
      Run-TryBot: David Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      897c0ebf
    • Keith Randall's avatar
      test,cmd/compile: remove _ssa file suffix · b265d517
      Keith Randall authored
      Everything is SSA now.
      
      Update #16357
      
      Change-Id: I436dbe367b863ee81a3695a7d653ba4bfc5b0f6c
      Reviewed-on: https://go-review.googlesource.com/29232Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      b265d517
    • Keith Randall's avatar
      test: make SSA tests unconditional · f13701bf
      Keith Randall authored
      Delete legacy backend tests, make SSA tests unconditional.
      
      Next CL will remove _ssa from the file names.
      
      Update #16357
      
      Change-Id: I2a7f5dcbc69455f63b5e6e6b2725df26ab86c8dd
      Reviewed-on: https://go-review.googlesource.com/29231
      Run-TryBot: Keith Randall <khr@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      f13701bf
    • Sam Whited's avatar
      cmd/fix: add golang.org/x/net/context fix · 22d3bf1d
      Sam Whited authored
      Fixes #17040
      
      Change-Id: I3682cc0367b919084c280d7dc64746495c1d4aaa
      Reviewed-on: https://go-review.googlesource.com/28872Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      22d3bf1d
    • Mohit Agarwal's avatar
      cmd/go: add distribution-specific info for Linux to bug command · 4466298d
      Mohit Agarwal authored
      Also remove the hard-coded path for getting glibc information.
      
      As an example, the following is the diff for `go bug` on Ubuntu before
      and after the change:
      
      >>>
      --- /tmp/01     2016-09-13 15:08:53.202758043 +0530
      +++ /tmp/02     2016-09-13 21:38:17.485039867 +0530
      @@ -1,7 +1,7 @@
       Please check whether the issue also reproduces on the latest release, go1.7.1.
      
       ```
      -go version devel +bdb3b790 Wed Sep 7 03:23:44 2016 +0000 linux/amd64
      +go version devel +cb13150 Wed Sep 7 09:46:58 2016 +0530 linux/amd64
       GOARCH="amd64"
       GOBIN=""
       GOEXE=""
      @@ -18,5 +18,23 @@
       CXX="g++"
       CGO_ENABLED="1"
       uname -sr: Linux 4.4.0-36-generic
      +Distributor ID:        Ubuntu
      +Description:   Ubuntu 16.04.1 LTS
      +Release:       16.04
      +Codename:      xenial
      +/lib/x86_64-linux-gnu/libc.so.6: GNU C Library (Ubuntu GLIBC 2.23-0ubuntu3) stable release version 2.23, by Roland McGrath et al.
       gdb --version: GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
       ```
      <<<
      
      Change-Id: I7e3730a797af0f94d6e43fe4743ab48bc0f11f1b
      Reviewed-on: https://go-review.googlesource.com/28581
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      4466298d
    • David Chase's avatar
      cmd/compile: repair GOSSAFUNC functionality · 3eb16c05
      David Chase authored
      GOSSAFUNC=foo had previously only done printing for the
      single function foo, and didn't quite clean up after itself
      properly. Changes ensures that Config.HTML != nil iff
      GOSSAFUNC==name-of-current-function.
      
      Change-Id: I255e2902dfc64f715d93225f0d29d9525c06f764
      Reviewed-on: https://go-review.googlesource.com/29250
      Run-TryBot: David Chase <drchase@google.com>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      3eb16c05
    • Josh Bleecher Snyder's avatar
      cmd/compile: remove gins · ad7732a9
      Josh Bleecher Snyder authored
      The only remaining consumers of gins were
      ginsnop and arch-independent opcodes like GVARDEF.
      Rewrite ginsnop to create and populate progs directly.
      Move arch-independent opcodes to package gc
      and simplify.
      Delete some now unused code.
      There is more.
      Step one towards eliminating gc.Node.Reg.
      
      Change-Id: I7c34cd8a848f6fc3b030705ab8e293838e0b6c20
      Reviewed-on: https://go-review.googlesource.com/29220
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      ad7732a9
    • Josh Bleecher Snyder's avatar
      cmd/compile: nodintconst is the new Nodintconst · a06e931a
      Josh Bleecher Snyder authored
      Fixes the build.
      
      Change-Id: Ib9aca6cf86d595d20f22dbf730afa8dea4b44672
      Reviewed-on: https://go-review.googlesource.com/29221Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      a06e931a
    • Josh Bleecher Snyder's avatar
      cmd/compile: unroll comparisons to short constant strings · c9fd9975
      Josh Bleecher Snyder authored
      Unroll s == "ab" to
      
      len(s) == 2 && s[0] == 'a' && s[1] == 'b'
      
      This generates faster and shorter code
      by avoiding a runtime call.
      Do something similar for !=.
      
      The cutoff length is 6. This was chosen empirically
      by examining binary sizes on arm, arm64, 386, and amd64
      using the SSA backend.
      
      For all architectures examined, 4, 5, and 6 were
      the ideal cutoff, with identical binary sizes.
      
      The distribution of constant string equality sizes
      during 'go build -a std' is:
      
       40.81%   622 len 0
       14.11%   215 len 4
        9.45%   144 len 1
        7.81%   119 len 3
        7.48%   114 len 5
        5.12%    78 len 7
        4.13%    63 len 2
        3.54%    54 len 8
        2.69%    41 len 6
        1.18%    18 len 10
        0.85%    13 len 9
        0.66%    10 len 14
        0.59%     9 len 17
        0.46%     7 len 11
        0.26%     4 len 12
        0.20%     3 len 19
        0.13%     2 len 13
        0.13%     2 len 15
        0.13%     2 len 16
        0.07%     1 len 20
        0.07%     1 len 23
        0.07%     1 len 33
        0.07%     1 len 36
      
      A cutoff of length 6 covers most of the cases.
      
      Benchmarks on amd64 comparing a string to a constant of length 3:
      
      Cmp/1same-8           4.78ns ± 6%  0.94ns ± 9%  -80.26%  (p=0.000 n=20+20)
      Cmp/1diffbytes-8      6.43ns ± 6%  0.96ns ±11%  -85.13%  (p=0.000 n=20+20)
      Cmp/3same-8           4.71ns ± 5%  1.28ns ± 5%  -72.90%  (p=0.000 n=20+20)
      Cmp/3difffirstbyte-8  6.33ns ± 7%  1.27ns ± 7%  -79.90%  (p=0.000 n=20+20)
      Cmp/3difflastbyte-8   6.34ns ± 8%  1.26ns ± 9%  -80.13%  (p=0.000 n=20+20)
      
      The change to the prove test preserves the
      existing intent of the test. When the string was
      short, there was a new "proved in bounds" report
      that referred to individual byte comparisons.
      
      Change-Id: I593ac303b0d11f275672090c5c786ea0c6b8da13
      Reviewed-on: https://go-review.googlesource.com/26758
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      c9fd9975