compiler: discard global sink variables with static initializers
authorIan Lance Taylor <iant@golang.org>
Tue, 15 Dec 2020 04:41:30 +0000 (20:41 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 15 Dec 2020 20:56:50 +0000 (12:56 -0800)
commit8a5b8fc719f5c5bd6bd732d95646193238343f39
treeeddea22d69c0152b414957227fac616c3d41c6b0
parentf23753c710d54fdf6f6c6cbe93c5b0fdbf209fc8
compiler: discard global sink variables with static initializers

This is specifically for the test fixedbugs/issue23781.go, which
builds a large static array.  The code does compile and work without
this change, but it takes a long time and generates a large object
file.  Discarding the unnecessary static initializer makes this test
much faster.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/278172
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/gogo.cc
gcc/go/gofrontend/gogo.h
gcc/go/gofrontend/parse.cc