compiler: set "need_init_fn" when adding gc root

Variables that back slice initializers in certain cases have to be
added to the gc roots list, since they can be modified at runtime. The
code that was doing this addition did not update the flag that tracks
whether the package being compiled needs an initializer function,
which resulted in the call in question being left out of the final
generated code in certain cases. Fix is to change Gogo::add_gc_root()
to update the "needs init" flag.

Change-Id: Ic1da437a470716e99778592bc185ebd4ed8488c0
Reviewed-on: https://go-review.googlesource.com/43030
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/go/gogo.h b/go/gogo.h
index ab634f9..994f233 100644
--- a/go/gogo.h
+++ b/go/gogo.h
@@ -585,7 +585,10 @@
   // variable initializers that would otherwise not be seen.
   void
   add_gc_root(Expression* expr)
-  { this->gc_roots_.push_back(expr); }
+  {
+    this->set_need_init_fn();
+    this->gc_roots_.push_back(expr);
+  }
 
   // Traverse the tree.  See the Traverse class.
   void