1. 02 Feb, 2017 20 commits
    • Josh Bleecher Snyder's avatar
      cmd/compile, runtime: convert byte-sized values to interfaces without allocation · 03583675
      Josh Bleecher Snyder authored
      Based in part on khr's CL 2500.
      
      Updates #17725
      Updates #18121
      
      Change-Id: I744e1f92fc2104e6c5bd883a898c30b2eea8cc31
      Reviewed-on: https://go-review.googlesource.com/35555
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      03583675
    • Josh Bleecher Snyder's avatar
      cmd/compile: convert constants to interfaces without allocating · c682d323
      Josh Bleecher Snyder authored
      The order pass is responsible for ensuring that
      values passed to runtime functions, including
      convT2E/convT2I, are addressable.
      
      Prior to this CL, this was always accomplished
      by creating a temp, which frequently escaped to
      the heap, causing allocations, perhaps most
      notably in code like:
      
      fmt.Println(1, 2, 3) // allocates three times
      
      None of the runtime routines modify the contents
      of the pointers they receive, so in the case of
      constants, instead of creating a temp value,
      we can create a static value.
      
      (Marking the static value as read-only provides
      protection against accidental attempts by the runtime
      to modify the constant data.)
      
      This improves code generation for code like:
      
      panic("abc")
      c <- 2 // c is a chan int
      
      which can now simply refer to "abc" and 2,
      rather than going by way of a temporary.
      
      It also allows us to optimize convT2E/convT2I,
      by recognizing static readonly values
      and directly constructing the interface.
      
      This CL adds ~0.5% to binary size, despite
      decreasing the size of many functions,
      because it also adds many static symbols.
      
      This binary size regression could be recovered in
      future (but currently unplanned) work.
      
      There is a lot of content-duplication in these
      symbols; this statement generates six new symbols,
      three containing an int 1 and three containing
      a pointer to the string "a":
      
      fmt.Println(1, 1, 1, "a", "a", "a")
      
      These symbols could be made content-addressable.
      
      Furthermore, these symbols are small, so the
      alignment and naming overhead is large.
      As with the go.strings section, these symbols
      could be hidden and have their alignment reduced.
      
      The changes to test/live.go make it impossible
      (at least with current optimization techniques)
      to place the values being passed to the runtime
      in static symbols, preserving autotmp creation.
      
      Fixes #18704
      
      Benchmarks from fmt and go-kit's logging package:
      
      github.com/go-kit/kit/log
      
      name                      old time/op    new time/op    delta
      JSONLoggerSimple-8          1.91µs ± 2%    2.11µs ±22%     ~     (p=1.000 n=9+10)
      JSONLoggerContextual-8      2.60µs ± 6%    2.43µs ± 2%   -6.29%  (p=0.000 n=9+10)
      Discard-8                    101ns ± 2%      34ns ±14%  -66.33%  (p=0.000 n=10+9)
      OneWith-8                    161ns ± 1%     102ns ±16%  -36.78%  (p=0.000 n=10+10)
      TwoWith-8                    175ns ± 3%     106ns ± 7%  -39.36%  (p=0.000 n=10+9)
      TenWith-8                    293ns ± 3%     227ns ±15%  -22.44%  (p=0.000 n=9+10)
      LogfmtLoggerSimple-8         704ns ± 2%     608ns ± 2%  -13.65%  (p=0.000 n=10+9)
      LogfmtLoggerContextual-8     962ns ± 1%     860ns ±17%  -10.57%  (p=0.003 n=9+10)
      NopLoggerSimple-8            188ns ± 1%     120ns ± 1%  -36.39%  (p=0.000 n=9+10)
      NopLoggerContextual-8        379ns ± 1%     243ns ± 0%  -35.77%  (p=0.000 n=9+10)
      ValueBindingTimestamp-8      577ns ± 1%     499ns ± 1%  -13.51%  (p=0.000 n=10+10)
      ValueBindingCaller-8         898ns ± 2%     844ns ± 2%   -6.00%  (p=0.000 n=10+10)
      
      name                      old alloc/op   new alloc/op   delta
      JSONLoggerSimple-8            904B ± 0%      872B ± 0%   -3.54%  (p=0.000 n=10+10)
      JSONLoggerContextual-8      1.20kB ± 0%    1.14kB ± 0%   -5.33%  (p=0.000 n=10+10)
      Discard-8                    64.0B ± 0%     32.0B ± 0%  -50.00%  (p=0.000 n=10+10)
      OneWith-8                    96.0B ± 0%     64.0B ± 0%  -33.33%  (p=0.000 n=10+10)
      TwoWith-8                     160B ± 0%      128B ± 0%  -20.00%  (p=0.000 n=10+10)
      TenWith-8                     672B ± 0%      640B ± 0%   -4.76%  (p=0.000 n=10+10)
      LogfmtLoggerSimple-8          128B ± 0%       96B ± 0%  -25.00%  (p=0.000 n=10+10)
      LogfmtLoggerContextual-8      304B ± 0%      240B ± 0%  -21.05%  (p=0.000 n=10+10)
      NopLoggerSimple-8             128B ± 0%       96B ± 0%  -25.00%  (p=0.000 n=10+10)
      NopLoggerContextual-8         304B ± 0%      240B ± 0%  -21.05%  (p=0.000 n=10+10)
      ValueBindingTimestamp-8       159B ± 0%      127B ± 0%  -20.13%  (p=0.000 n=10+10)
      ValueBindingCaller-8          112B ± 0%       80B ± 0%  -28.57%  (p=0.000 n=10+10)
      
      name                      old allocs/op  new allocs/op  delta
      JSONLoggerSimple-8            19.0 ± 0%      17.0 ± 0%  -10.53%  (p=0.000 n=10+10)
      JSONLoggerContextual-8        25.0 ± 0%      21.0 ± 0%  -16.00%  (p=0.000 n=10+10)
      Discard-8                     3.00 ± 0%      1.00 ± 0%  -66.67%  (p=0.000 n=10+10)
      OneWith-8                     3.00 ± 0%      1.00 ± 0%  -66.67%  (p=0.000 n=10+10)
      TwoWith-8                     3.00 ± 0%      1.00 ± 0%  -66.67%  (p=0.000 n=10+10)
      TenWith-8                     3.00 ± 0%      1.00 ± 0%  -66.67%  (p=0.000 n=10+10)
      LogfmtLoggerSimple-8          4.00 ± 0%      2.00 ± 0%  -50.00%  (p=0.000 n=10+10)
      LogfmtLoggerContextual-8      7.00 ± 0%      3.00 ± 0%  -57.14%  (p=0.000 n=10+10)
      NopLoggerSimple-8             4.00 ± 0%      2.00 ± 0%  -50.00%  (p=0.000 n=10+10)
      NopLoggerContextual-8         7.00 ± 0%      3.00 ± 0%  -57.14%  (p=0.000 n=10+10)
      ValueBindingTimestamp-8       5.00 ± 0%      3.00 ± 0%  -40.00%  (p=0.000 n=10+10)
      ValueBindingCaller-8          4.00 ± 0%      2.00 ± 0%  -50.00%  (p=0.000 n=10+10)
      
      fmt
      
      name                             old time/op    new time/op    delta
      SprintfPadding-8                   88.9ns ± 3%    79.1ns ± 1%   -11.09%  (p=0.000 n=10+7)
      SprintfEmpty-8                     12.6ns ± 3%    12.8ns ± 3%      ~     (p=0.136 n=10+10)
      SprintfString-8                    38.7ns ± 5%    26.9ns ± 6%   -30.65%  (p=0.000 n=10+10)
      SprintfTruncateString-8            56.7ns ± 2%    47.0ns ± 3%   -17.05%  (p=0.000 n=10+10)
      SprintfQuoteString-8                164ns ± 2%     153ns ± 2%    -7.01%  (p=0.000 n=10+10)
      SprintfInt-8                       38.9ns ±15%    26.5ns ± 2%   -31.93%  (p=0.000 n=10+9)
      SprintfIntInt-8                    60.3ns ± 9%    38.2ns ± 1%   -36.67%  (p=0.000 n=10+8)
      SprintfPrefixedInt-8               58.6ns ±13%    51.2ns ±11%   -12.66%  (p=0.001 n=10+10)
      SprintfFloat-8                     71.4ns ± 3%    64.2ns ± 3%   -10.08%  (p=0.000 n=8+10)
      SprintfComplex-8                    175ns ± 3%     159ns ± 2%    -9.03%  (p=0.000 n=10+10)
      SprintfBoolean-8                   33.5ns ± 4%    25.7ns ± 5%   -23.28%  (p=0.000 n=10+10)
      SprintfHexString-8                 65.3ns ± 3%    51.7ns ± 5%   -20.86%  (p=0.000 n=10+9)
      SprintfHexBytes-8                  67.2ns ± 5%    67.9ns ± 4%      ~     (p=0.383 n=10+10)
      SprintfBytes-8                      129ns ± 7%     124ns ± 7%      ~     (p=0.074 n=9+10)
      SprintfStringer-8                   127ns ± 4%     126ns ± 8%      ~     (p=0.506 n=9+10)
      SprintfStructure-8                  357ns ± 3%     359ns ± 3%      ~     (p=0.469 n=10+10)
      ManyArgs-8                          203ns ± 6%     126ns ± 3%   -37.94%  (p=0.000 n=10+10)
      FprintInt-8                         119ns ±10%      74ns ± 3%   -37.54%  (p=0.000 n=10+10)
      FprintfBytes-8                      122ns ± 4%     120ns ± 3%      ~     (p=0.124 n=10+10)
      FprintIntNoAlloc-8                 78.2ns ± 5%    74.1ns ± 3%    -5.28%  (p=0.000 n=10+10)
      ScanInts-8                          349µs ± 1%     349µs ± 0%      ~     (p=0.606 n=9+8)
      ScanRecursiveInt-8                 43.8ms ± 7%    40.1ms ± 2%    -8.42%  (p=0.000 n=10+10)
      ScanRecursiveIntReaderWrapper-8    43.5ms ± 4%    40.4ms ± 2%    -7.16%  (p=0.000 n=10+9)
      
      name                             old alloc/op   new alloc/op   delta
      SprintfPadding-8                    24.0B ± 0%     16.0B ± 0%   -33.33%  (p=0.000 n=10+10)
      SprintfEmpty-8                      0.00B          0.00B           ~     (all equal)
      SprintfString-8                     21.0B ± 0%      5.0B ± 0%   -76.19%  (p=0.000 n=10+10)
      SprintfTruncateString-8             32.0B ± 0%     16.0B ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfQuoteString-8                48.0B ± 0%     32.0B ± 0%   -33.33%  (p=0.000 n=10+10)
      SprintfInt-8                        16.0B ± 0%      1.0B ± 0%   -93.75%  (p=0.000 n=10+10)
      SprintfIntInt-8                     24.0B ± 0%      3.0B ± 0%   -87.50%  (p=0.000 n=10+10)
      SprintfPrefixedInt-8                72.0B ± 0%     64.0B ± 0%   -11.11%  (p=0.000 n=10+10)
      SprintfFloat-8                      16.0B ± 0%      8.0B ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfComplex-8                    48.0B ± 0%     32.0B ± 0%   -33.33%  (p=0.000 n=10+10)
      SprintfBoolean-8                    8.00B ± 0%     4.00B ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfHexString-8                  96.0B ± 0%     80.0B ± 0%   -16.67%  (p=0.000 n=10+10)
      SprintfHexBytes-8                    112B ± 0%      112B ± 0%      ~     (all equal)
      SprintfBytes-8                      96.0B ± 0%     96.0B ± 0%      ~     (all equal)
      SprintfStringer-8                   32.0B ± 0%     32.0B ± 0%      ~     (all equal)
      SprintfStructure-8                   256B ± 0%      256B ± 0%      ~     (all equal)
      ManyArgs-8                          80.0B ± 0%      0.0B       -100.00%  (p=0.000 n=10+10)
      FprintInt-8                         8.00B ± 0%     0.00B       -100.00%  (p=0.000 n=10+10)
      FprintfBytes-8                      32.0B ± 0%     32.0B ± 0%      ~     (all equal)
      FprintIntNoAlloc-8                  0.00B          0.00B           ~     (all equal)
      ScanInts-8                         15.2kB ± 0%    15.2kB ± 0%      ~     (p=0.248 n=9+10)
      ScanRecursiveInt-8                 21.6kB ± 0%    21.6kB ± 0%      ~     (all equal)
      ScanRecursiveIntReaderWrapper-8    21.7kB ± 0%    21.7kB ± 0%      ~     (all equal)
      
      name                             old allocs/op  new allocs/op  delta
      SprintfPadding-8                     2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfEmpty-8                       0.00           0.00           ~     (all equal)
      SprintfString-8                      2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfTruncateString-8              2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfQuoteString-8                 2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfInt-8                         2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfIntInt-8                      3.00 ± 0%      1.00 ± 0%   -66.67%  (p=0.000 n=10+10)
      SprintfPrefixedInt-8                 2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfFloat-8                       2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfComplex-8                     2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfBoolean-8                     2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfHexString-8                   2.00 ± 0%      1.00 ± 0%   -50.00%  (p=0.000 n=10+10)
      SprintfHexBytes-8                    2.00 ± 0%      2.00 ± 0%      ~     (all equal)
      SprintfBytes-8                       2.00 ± 0%      2.00 ± 0%      ~     (all equal)
      SprintfStringer-8                    4.00 ± 0%      4.00 ± 0%      ~     (all equal)
      SprintfStructure-8                   7.00 ± 0%      7.00 ± 0%      ~     (all equal)
      ManyArgs-8                           8.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)
      FprintInt-8                          1.00 ± 0%      0.00       -100.00%  (p=0.000 n=10+10)
      FprintfBytes-8                       1.00 ± 0%      1.00 ± 0%      ~     (all equal)
      FprintIntNoAlloc-8                   0.00           0.00           ~     (all equal)
      ScanInts-8                          1.60k ± 0%     1.60k ± 0%      ~     (all equal)
      ScanRecursiveInt-8                  1.71k ± 0%     1.71k ± 0%      ~     (all equal)
      ScanRecursiveIntReaderWrapper-8     1.71k ± 0%     1.71k ± 0%      ~     (all equal)
      
      Change-Id: I7ba72a25fea4140a0ba40a9f443103ed87cc69b5
      Reviewed-on: https://go-review.googlesource.com/35554
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      c682d323
    • David Lazar's avatar
      io: fix test when MultiReader is inlined with -l=3 · f395e878
      David Lazar authored
      This ensures there isn't a live reference to buf1 on our stack
      when MultiReader is inlined.
      
      Fixes #18819.
      
      Change-Id: I96a8cdc1ffad8f8a10c0ddcbf0299005f3176b61
      Reviewed-on: https://go-review.googlesource.com/35931
      Run-TryBot: David Lazar <lazard@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      f395e878
    • Josh Bleecher Snyder's avatar
      cmd/compile: reduce slice growth in fuseBlockPlain · 16e430e1
      Josh Bleecher Snyder authored
      Instead of always appending to c.Values,
      choose whichever slice is larger;
      b.Values will be set to nil anyway.
      
      Appending once instead of in a loop also
      limits slice growth to once per function call
      and is more efficient.
      
      Reduces max rss for the program in #18602 by 6.5%,
      and eliminates fuseBlockPlain from the alloc_space
      pprof output. fuseBlockPlain previously accounted
      for 16.74% of allocated memory.
      
      Updates #18602.
      
      Change-Id: I417b03722d011a59a679157da43dc91f4425210e
      Reviewed-on: https://go-review.googlesource.com/35114
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      16e430e1
    • Keith Randall's avatar
      cmd/compile: move rotate instruction generation to SSA · 01c8719f
      Keith Randall authored
      Remove rotate generation from walk.  Remove OLROT and ssa.Lrot* opcodes.
      Generate rotates during SSA lowering for architectures that have them.
      
      This CL will allow rotates to be generated in more situations,
      like when the shift values are determined to be constant
      only after some analysis.
      
      Fixes #18254
      
      Change-Id: I8d6d684ff5ce2511aceaddfda98b908007851079
      Reviewed-on: https://go-review.googlesource.com/34232
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      01c8719f
    • Keith Randall's avatar
      cmd/compile: allow inlining of functions with intrinsics in them · 8a9dc053
      Keith Randall authored
      Intrinsics are ok to inline as they don't rewrite to actual calls.
      
      Change-Id: Ieb19c834c61579823c62c6d1a1b425d6c4d4de23
      Reviewed-on: https://go-review.googlesource.com/34272
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      8a9dc053
    • Keith Randall's avatar
      cmd/compile: use len(s)<=cap(s) to remove more bounds checks · 73f92f9b
      Keith Randall authored
      When we discover a relation x <= len(s), also discover the relation
      x <= cap(s).  That way, in situations like:
      
      a := s[x:]  // tests 0 <= x <= len(s)
      b := s[:x]  // tests 0 <= x <= cap(s)
      
      the second check can be eliminated.
      
      Fixes #16813
      
      Change-Id: Ifc037920b6955e43bac1a1eaf6bac63a89cfbd44
      Reviewed-on: https://go-review.googlesource.com/33633
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAlexandru Moșoi <alexandru@mosoi.ro>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      73f92f9b
    • Keith Randall's avatar
      cmd/compile: fix CSE with commutative ops · 6317f92f
      Keith Randall authored
      CSE opportunities were being missed for commutative ops. We used to
      order the args of commutative ops (by arg ID) once at the start of CSE.
      But that may not be enough.
      
      i1 = (Load ptr mem)
      i2 = (Load ptr mem)
      x1 = (Add i1 j)
      x2 = (Add i2 j)
      
      Equivalent commutative ops x1 and x2 may not get their args ordered in
      the same way because because at the start of CSE, we don't know that
      the i values will be CSEd. If x1 and x2 get opposite orders we won't
      CSE them.
      
      Instead, (re)order the args of commutative operations by their
      equivalence class IDs each time we partition an equivalence class.
      
      Change-Id: Ic609fa83b85299782a5e85bf93dc6023fccf4b0c
      Reviewed-on: https://go-review.googlesource.com/33632
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarTodd Neal <todd@tneal.org>
      6317f92f
    • Emmanuel Odeke's avatar
      cmd/compile: improve error for wrong type in switch · 34b563f4
      Emmanuel Odeke authored
      Fixes #10561.
      
      Provides a better diagnostic message for failed type switch
      satisfaction in the case that a value receiver is being used
      in place of the pointer receiver that implements and satisfies
      the interface.
      
      Change-Id: If8c13ba13f2a8d81bf44bac7c3a66c12921ba921
      Reviewed-on: https://go-review.googlesource.com/35235Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      34b563f4
    • Hiroshi Ioka's avatar
      cmd/cgo: don't track same node twice in guessKinds · ba1a65fc
      Hiroshi Ioka authored
      Change-Id: Ib2c1490a42e3485913a05a0b2fecdcc425d42871
      Reviewed-on: https://go-review.googlesource.com/36083
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      ba1a65fc
    • Daniel Martí's avatar
      misc/cgo/testshared: remove unused flag.Parse() · 329fff0d
      Daniel Martí authored
      TestMain doesn't make use of any flags.
      
      Change-Id: I98ec582fb004045a5067618f605ccfeb1f9f4bbb
      Reviewed-on: https://go-review.googlesource.com/33613Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
      Run-TryBot: David Crawshaw <crawshaw@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      329fff0d
    • Elias Naur's avatar
      misc/ios: allow exit code 0 to mean test success · 312ea5bf
      Elias Naur authored
      Tests that use TestMain might never call m.Run(), and simply return
      from TestMain. In that case, the iOS test harness never sees the
      PASS from the testing framework and assumes the test failed.
      
      Allow an exit with exit code 0 to also mean test success, thereby
      fixing the objdump test on iOS.
      
      Change-Id: I1fe9077b05931aa0905e41b88945cd153c5b35b6
      Reviewed-on: https://go-review.googlesource.com/36065Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
      Run-TryBot: Elias Naur <elias.naur@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      312ea5bf
    • Emmanuel Odeke's avatar
      cmd/compile: improve error message if init is directly invoked · cb6e0639
      Emmanuel Odeke authored
      Fixes #8481.
      
      Inform the user that init functions cannot be directly invoked
      in user code, as mandated by the spec at:
      http://golang.org/ref/spec#Program_initialization_and_execution.
      
      Change-Id: Ib12c0c08718ffd48b76b6f9b13c76bb6612d2e7b
      Reviewed-on: https://go-review.googlesource.com/34790Reviewed-by: default avatarKeith Randall <khr@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      cb6e0639
    • Martin Möhrmann's avatar
      cmd/compile: intrinsify math.Sqrt by using only the ssa backend · dbd51ce9
      Martin Möhrmann authored
      Change-Id: If3cb64f52fe0fd7331b6f1acf3d15dd705dfd633
      Reviewed-on: https://go-review.googlesource.com/32591
      Run-TryBot: Martin Möhrmann <moehrmann@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      dbd51ce9
    • Emmanuel Odeke's avatar
      cmd/compile: fix conversion error message for printed slices · dba0d382
      Emmanuel Odeke authored
      Fixes #15055.
      
      Updates exprfmt printing using fmt verb "%v" to check that n.Left
      is non-nil before attempting to print it, otherwise we'll print
      the nodes in the list using verb "%.v".
      
      Credit to @mdempsky for this approach and for finding
      the root cause of the issue.
      
      Change-Id: I20a6464e916dc70d5565e145164bb9553e5d3865
      Reviewed-on: https://go-review.googlesource.com/25361Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      dba0d382
    • Josh Bleecher Snyder's avatar
      test: add extra test for issue18661 · b443baba
      Josh Bleecher Snyder authored
      Make sure that the lack of an lvalue doesn't
      cause extra side-effects.
      
      Updates #18661
      Updates #18739
      
      Change-Id: I52eb4b4a5c6f8ff5cddd2115455f853c18112c19
      Reviewed-on: https://go-review.googlesource.com/36126
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      b443baba
    • Matthew Dempsky's avatar
      cmd/compile: skip reexporting types in reexportdep · edad59cf
      Matthew Dempsky authored
      The binary export format embeds type definitions inline as necessary,
      so there's no need to add them to exportlist. Also, constants are
      embedded directly by value, so they can be omitted too.
      
      Change-Id: Id1879eb97c298a5a52f615cf9883c346c7f7bd69
      Reviewed-on: https://go-review.googlesource.com/36170
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      edad59cf
    • Matthew Dempsky's avatar
      cmd/compile/internal/gc: add comment and test for #15550 · 16dd0624
      Matthew Dempsky authored
      When switching to the new parser, I changed cmd/compile to handle iota
      per an intuitive interpretation of how nested constant declarations
      should work (which also matches go/types).
      
      Note: if we end up deciding that the current spec wording is
      intentional (i.e., confirming gccgo's current behavior), the test will
      need to be updated to expect 4 instead of 1.
      
      Updates #15550.
      
      Change-Id: I441f5f13209f172b73ef75031f2a9daa5e985277
      Reviewed-on: https://go-review.googlesource.com/36122Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      16dd0624
    • Alex Brainman's avatar
      cmd/link: assume that runtime.epclntab lives in .text section · 99e1e4f6
      Alex Brainman authored
      Sometimes STEXT symbols point to the first byte of .data
      section, instead of the end of .text section. But, while writing
      pe symbol table, we should treat them as if they belong to the
      .text section. Change pe symbol table records for these symbols.
      
      Fixes #14710
      
      Change-Id: I1356e61aa8fa37d590d7b1677b2bac214ad0ba4e
      Reviewed-on: https://go-review.googlesource.com/35272
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      99e1e4f6
    • Ian Lance Taylor's avatar
      cmd/compile: update maxPtrmaskBytes comment for larger value · 08a3a7c0
      Ian Lance Taylor authored
      The comment for maxPtrmaskBytes implied that the value was still 16,
      but that changed in CL 10815.
      
      Change-Id: I86e304bc7d9d1a0a6b22b600fefcc1325e4372d9
      Reviewed-on: https://go-review.googlesource.com/36120Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
      Reviewed-by: default avatarAustin Clements <austin@google.com>
      08a3a7c0
  2. 01 Feb, 2017 20 commits