1. 19 Oct, 2016 33 commits
  2. 18 Oct, 2016 7 commits
    • Robert Griesemer's avatar
      spec: require 16 bit minimum exponent in constants rather than 32 · 8fbfdad2
      Robert Griesemer authored
      A 16bit binary exponent permits a constant range covering roughly the range
      from 7e-9865 to 7e9863 which is more than enough for any practical and
      hypothetical constant arithmetic.
      
      Furthermore, until recently cmd/compile could not handle very large exponents
      correctly anyway; i.e., the chance that any real programs (but for tests that
      explore corner cases) are affected are close to zero.
      
      Finally, restricting the minimum supported range significantly reduces the
      implementation complexity in an area that hardly matters in reality for new
      or alternative spec-compliant implementations that don't or cannot rely on
      pre-existing arbitratry precision arithmetic packages that support a 32bit
      exponent range.
      
      This is technically a language change but for the reasons mentioned above
      this is unlikely to affect any real programs, and certainly not programs
      compiled with the gc or gccgo compilers as they currently support up to
      32bit exponents.
      
      Fixes #13572.
      
      Change-Id: I970f919c57fc82c0175844364cf48ea335f17d39
      Reviewed-on: https://go-review.googlesource.com/17711Reviewed-by: default avatarRob Pike <r@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      8fbfdad2
    • Matthew Dempsky's avatar
      cmd/compile: handle unsafe builtins like universal builtins · 3f2cb493
      Matthew Dempsky authored
      Reuse the same mechanisms for handling universal builtins like len to
      handle unsafe.Sizeof, etc. Allows us to drop package unsafe's export
      data, and simplifies some code.
      
      Updates #17508.
      
      Change-Id: I620e0617c24e57e8a2d7cccd0e2de34608779656
      Reviewed-on: https://go-review.googlesource.com/31433
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      3f2cb493
    • Mohit Agarwal's avatar
      math: speed up Gamma(+Inf) · 7eed848a
      Mohit Agarwal authored
      Add special case for Gamma(+∞) which speeds it up:
      
      benchmark            old ns/op     new ns/op     delta
      BenchmarkGamma-4     14.5          7.44          -48.69%
      
      The documentation for math.Gamma already specifies it as a special
      case:
      
              Gamma(+Inf) = +Inf
      
      The original C code that has been used as the reference implementation
      (as mentioned in the comments in gamma.go) also treats Gamma(+∞) as a
      special case:
      
      if( x == INFINITY )
              return(x);
      
      Change-Id: Idac36e19192b440475aec0796faa2d2c7f8abe0b
      Reviewed-on: https://go-review.googlesource.com/31370Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      7eed848a
    • Brad Fitzpatrick's avatar
      net/http: update test to check Content-Length 0 Body more reliably · 97b04152
      Brad Fitzpatrick authored
      The way to send an explicitly-zero Content-Length is to set a nil Body.
      
      Fix this test to do that, rather than relying on type sniffing.
      
      Updates #17480
      Updates #17071
      
      Change-Id: I6a38e20f17013c88ec4ea69d73c507e4ed886947
      Reviewed-on: https://go-review.googlesource.com/31434
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarChris Broadfoot <cbro@golang.org>
      97b04152
    • Quentin Smith's avatar
      cmd/go: print more env variables in "go env" · 75fef5a0
      Quentin Smith authored
      "go env" previously only printed a subset of the documented environment
      variables; now it includes everything, such as GO386 and CGO_*.
      
      This also fixes the CGO_CFLAGS environment variable to always have the
      same default. According to iant@ and confirmed by testing, cgo can now
      understand the default value of CGO_CFLAGS.
      
      Fixes #17191.
      
      Change-Id: Icf75055446dd250b6256ef1139e9ce848f4a9d3b
      Reviewed-on: https://go-review.googlesource.com/31330
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Run-TryBot: Quentin Smith <quentin@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      75fef5a0
    • Dhananjay Nakrani's avatar
      cmd/compile: fix code duplication in race-instrumentation · 8b3194ac
      Dhananjay Nakrani authored
      instrumentnode() accidentally copies parent's already-instrumented nodes
      into child's Ninit block. This generates repeated code in race-instrumentation.
      This case surfaces only when it duplicates inline-labels, because of
      compile time error. In other cases, it silently generates incorrect
      instrumented code. This change prevents it from doing so.
      
      Fixes #17449.
      
      Change-Id: Icddf2198990442166307e176b7e20aa0cf6c171c
      Reviewed-on: https://go-review.googlesource.com/31317Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      8b3194ac
    • Matthew Dempsky's avatar
      cmd/compile: stop treating interface methods like actual functions · 2b687a7d
      Matthew Dempsky authored
      Interface methods can't have function bodies, so there's no need to
      process their parameter lists as variable declarations. The only
      possible reason would be to check for duplicate parameter names and/or
      invalid types, but we do that anyway, and have regression tests for it
      (test/funcdup.go).
      
      Change-Id: Iedb15335467caa5d872dbab829bf32ab8cf6204d
      Reviewed-on: https://go-review.googlesource.com/31430
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      2b687a7d