1. 05 Feb, 2018 1 commit
  2. 02 Feb, 2018 5 commits
  3. 31 Jan, 2018 10 commits
  4. 30 Jan, 2018 7 commits
  5. 29 Jan, 2018 2 commits
  6. 28 Jan, 2018 1 commit
  7. 26 Jan, 2018 2 commits
  8. 25 Jan, 2018 5 commits
  9. 24 Jan, 2018 5 commits
  10. 23 Jan, 2018 2 commits
    • Keith Randall's avatar
      cmd/compile: don't let spills clobber arguments · 7eaa8efb
      Keith Randall authored
      The compiler allows code to have multiple differently-typed views of a
      single argument. For instance, if we have
      
      func f(x float64) {
         y := *(*int64)(unsafe.Pointer(&x))
         ...
      }
      
      Then in SSA we get two OpArg ops, one with float64 type and one with
      int64 type.
      
      The compiler will try to reuse argument slots for spill slots. It
      checks that the argument slot is dead by consulting an interference
      graph.
      
      When building the interference graph, we normally ignore cross-type
      edges because the values on either end of that edge can't be allocated
      to the same slot. (This is just a space-saving optimization.) This
      rule breaks down when one of the values is an argument, because of the
      multiple views described above. If we're spilling a float64, it is not
      enough that the float64 version of x is dead; the int64 version of x
      has to be dead also.
      
      Remove the optimization of not recording interference edges if types
      don't match. That optimization is incorrect if one of the values
      connected by the edge is an argument.
      
      Fixes #23522
      
      Change-Id: I361f85d80fe3bc7249014ca2c3ec887c3dc30271
      Reviewed-on: https://go-review.googlesource.com/89335
      Run-TryBot: Keith Randall <khr@golang.org>
      Reviewed-by: 's avatarDavid Chase <drchase@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      7eaa8efb
    • Robert Griesemer's avatar
      go/types: more robust behavior in the presence errors (due to import "C") · f27a1ff2
      Robert Griesemer authored
      - Don't complain about invalid constant type if the type is
        invalid already (we do this in other places as well). This
        is useful to do in general, and even more so if we have
        invalid types due to import "C".
      
      - Type-check the lhs of an assignment even if we bail out early
        due to an error on the rhs. This was simply an oversight. We
        already have machinery in place to "use" expressions; in this
        case we just have to also make sure we don't overcount "uses"
        of variables on the lhs.
      
      - Fix overcount uses correction in assignments: Only do it if
        the variable in question is declared inside the same package
        to avoid possible race conditions when type-checking exported
        variables concurrently.
      
      Fixes #22090.
      
      Change-Id: I4c1b59f9ce38970e7129fedc5f6023908386e4f1
      Reviewed-on: https://go-review.googlesource.com/88375Reviewed-by: 's avatarAlan Donovan <adonovan@google.com>
      f27a1ff2