aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-08-21 14:11:24 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-08-21 14:11:24 +0000
commit7f8c0c0504d95c983aa138fd67aa2267f96853f9 (patch)
tree723d1df4aa9586b155be9c7470a6bffffa47f103
parent077eb7af6e296e45e8f333f799170685b4d77b03 (diff)
downloadgcc-7f8c0c0504d95c983aa138fd67aa2267f96853f9.zip
gcc-7f8c0c0504d95c983aa138fd67aa2267f96853f9.tar.gz
gcc-7f8c0c0504d95c983aa138fd67aa2267f96853f9.tar.bz2
compiler: if hidden function referenced by inline, don't hide descriptor
Fixes golang/go#33739 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191037 From-SVN: r274800
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/expressions.cc6
-rw-r--r--gcc/go/gofrontend/gogo.h5
3 files changed, 11 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 2776fb8..29f5ec0 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -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.
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index aa0fda0..0cf1710 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -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,
diff --git a/gcc/go/gofrontend/gogo.h b/gcc/go/gofrontend/gogo.h
index 0abd4b4..4521763 100644
--- a/gcc/go/gofrontend/gogo.h
+++ b/gcc/go/gofrontend/gogo.h
@@ -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()