compiler: if hidden function referenced by inline, don't hide descriptor
authorIan Lance Taylor <ian@gcc.gnu.org>
Wed, 21 Aug 2019 14:11:24 +0000 (14:11 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 21 Aug 2019 14:11:24 +0000 (14:11 +0000)
    Fixes golang/go#33739

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191037

From-SVN: r274800

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/gogo.h

index 2776fb80224e2ef1235544d7de79950db2b4716b..29f5ec01637cefe88758e8538c6525f453fa4f1e 100644 (file)
@@ -1,4 +1,4 @@
-1846b07fec2b91facc02ea269f7ab250b30f90b4
+7da359f4659fffff051c05ff442037cfa61febd5
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index aa0fda091bd374c76d441276b29074f3b25949c1..0cf1710d0c2e5ec58c293c8c419310543703147c 100644 (file)
@@ -1560,10 +1560,14 @@ Func_descriptor_expression::do_get_backend(Translate_context* context)
              || no->name().find("equal") != std::string::npos))
        is_exported_runtime = true;
 
+      bool is_referenced_by_inline =
+       no->is_function() && no->func_value()->is_referenced_by_inline();
+
       bool is_hidden = ((no->is_function()
                         && no->func_value()->enclosing() != NULL)
                        || (Gogo::is_hidden_name(no->name())
-                           && !is_exported_runtime)
+                           && !is_exported_runtime
+                           && !is_referenced_by_inline)
                        || Gogo::is_thunk(no));
 
       bvar = context->backend()->immutable_struct(var_name, asm_name,
index 0abd4b4cb2a5de29c19294e9d24b315ba07faf54..4521763611674a9ab697e4c5ec9c9eb5c577fb11 100644 (file)
@@ -1543,6 +1543,11 @@ class Function
   set_is_inline_only()
   { this->is_inline_only_ = true; }
 
+  // Report whether the function is referenced by an inline body.
+  bool
+  is_referenced_by_inline() const
+  { return this->is_referenced_by_inline_; }
+
   // Mark the function as referenced by an inline body.
   void
   set_is_referenced_by_inline()