• Daniel Morsing's avatar
    cmd/gc: emit code for extern = <N> · 0edafefc
    Daniel Morsing authored
    https://golang.org/cl/152700045/ made it possible for struct literals assigned to globals to use <N> as the RHS. Normally, this is to zero out variables on first use. Because globals are already zero (or their linker initialized value), we just ignored this.
    
    Now that <N> can occur from non-initialization code, we need to emit this code. We don't use <N> for initialization of globals any more, so this shouldn't cause any excessive zeroing.
    
    Fixes #8961.
    
    LGTM=rsc
    R=golang-codereviews, rsc
    CC=bradfitz, golang-codereviews
    https://golang.org/cl/154540044
    0edafefc
gen.c 17.7 KB