diff options
| -rw-r--r-- | gcc/go/gofrontend/gogo.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc index aa62ce6..9e51b63 100644 --- a/gcc/go/gofrontend/gogo.cc +++ b/gcc/go/gofrontend/gogo.cc @@ -1384,7 +1384,11 @@ Gogo::determine_types() // If this is a global variable which requires runtime // initialization, we need an initialization function. - if (!variable->is_global() || variable->init() == NULL) + if (!variable->is_global()) + ; + else if (variable->has_pre_init()) + this->need_init_fn_ = true; + else if (variable->init() == NULL) ; else if (variable->type()->interface_type() != NULL) this->need_init_fn_ = true; |
