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.

Change-Id: Ic15b462bf049c0b19dce330e5925e6989775f369
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/278172
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
3 files changed