Descriptioncmd/gc: permit link-time init of zeroed copy in pure Go package
For code like
var y = x
var x int
the compiler can initialize x at link time, rather than using
an init-time assignment. The compiler used to also initialize
y at link time, but that does not work if x is actually
initialized in C or assembly code. See issue 7665 and
https://codereview.appspot.com/93200044/ .
However, for pure Go code, we can safely initialize initialize
y at link time. This tweaks the fix for issue 7665 so that we
initialize y at link time if we know that there is no C or
assembly code in the package.
Patch Set 1 #Patch Set 2 : diff -r 53ebc70d4e9f843cb718f173e3225e9a0fc121e2 https://code.google.com/p/go # |