• Russ Cox's avatar
    cmd/gc: eliminate redundant &x.Field nil checks · aa0439ba
    Russ Cox authored
    This eliminates ~75% of the nil checks being emitted,
    on all architectures. We can do better, but we need
    a bit more general support from the compiler, and
    I don't want to do that so close to Go 1.2.
    What's here is simple but effective and safe.
    
    A few small code generation cleanups were required
    to make the analysis consistent on all systems about
    which nil checks are omitted, at least in the test.
    
    Fixes #6019.
    
    R=ken2
    CC=golang-dev
    https://golang.org/cl/13334052
    aa0439ba
nilptr3.go 4.28 KB