/ go Public
cmd/link: optimize init code, make it generate less asm code and make binary smaller and faster #22387
Issues related to the Go compiler and/or runtime.
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Issues that may be good for new contributors looking for work to do.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version go1.9 darwin/amd64
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/m9/qtbxkp6s3p96fk54rln7qhj80000gp/T/go-build753370285=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
What did you expect to see?
The init call tree should be ordered and flat.
The empty init functions should be remove.
main.Init direct call all init functions in the correct order(this one can be compute from import tree):
What did you see instead?
main.Init() just call strconv.init() os.init() which are defined in main package.
os.init call io.init, runtime.init, sync.init, time.init, internal/poll.init .
The panic message stack in some deep package like
runtime.initalso complex with os.init and main.Init(I just found why it is from this asm code)
ps: This program import tree map from go1.9:
The text was updated successfully, but these errors were encountered: