From 6df1f72e94e2d66a56952b541d66739e5f43165b Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor <ian@gcc.gnu.org>
Date: Thu, 10 Feb 2011 22:35:32 +0000
Subject: [PATCH] Determine types in global variable preinit blocks.

From-SVN: r170025
---
 gcc/go/gofrontend/gogo.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc
index aa66cf4d1098..e3c56b6318d0 100644
--- a/gcc/go/gofrontend/gogo.cc
+++ b/gcc/go/gofrontend/gogo.cc
@@ -3357,6 +3357,9 @@ Variable::type() const
 void
 Variable::determine_type()
 {
+  if (this->preinit_ != NULL)
+    this->preinit_->determine_types();
+
   // A variable in a type switch with a nil case will have the wrong
   // type here.  It will have an initializer which is a type guard.
   // We want to initialize it to the value without the type guard, and
-- 
GitLab