]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: make isfat handle 1-element array, 1-field struct
authorLE Manh Cuong <cuong.manhle.vn@gmail.com>
Thu, 30 May 2019 06:01:03 +0000 (13:01 +0700)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 28 Aug 2019 19:48:31 +0000 (19:48 +0000)
commit53227762153afb39c979810bd59ec139e3c8127d
tree4f6df0cc92aa593fbca9ddaa7707d0f286b38fd9
parent515bb0129df2d8462d561301cf9982f2b01de7f8
cmd/compile: make isfat handle 1-element array, 1-field struct

This will improve liveness analysis slightly, the same logic as
isdirectiface curently does. In:

type T struct {
    m map[int]int
}

        v := T{}
        v.m = make(map[int]int)

T is considered "fat", now it is not. So assigning to v.m is considered
to clobber the entire v.

This is follow up of CL 179057.

Change-Id: Id6b4807b8e8521ef5d8bcb14fedb6dceb9dbf18c
Reviewed-on: https://go-review.googlesource.com/c/go/+/179578
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/plive.go
test/live.go
test/live2.go