From 8a5b8fc719f5c5bd6bd732d95646193238343f39 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 14 Dec 2020 20:41:30 -0800 Subject: 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/parse.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/go/gofrontend/parse.cc') diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc index a4740cf..3b2e5a7 100644 --- a/gcc/go/gofrontend/parse.cc +++ b/gcc/go/gofrontend/parse.cc @@ -2075,6 +2075,7 @@ Parse::create_dummy_global(Type* type, Expression* init, if (type == NULL && init == NULL) type = Type::lookup_bool_type(); Variable* var = new Variable(type, init, true, false, false, location); + var->set_is_global_sink(); static int count; char buf[30]; snprintf(buf, sizeof buf, "_.%d", count); -- cgit v1.1