Hi,

we have found out that when building a shared object file with
pure/const HSA functions in them, we hit an assert in
binds_to_current_def_p.  The reason is that we are creating a clone
for the HSA implementation and even though normally clones are
private, ours isn't and so we need to set back not only the
TREE_PUBLIC flag but also the cgraph externally_visible flag.

I will commit it to the branch and queue for trunk for later.

Thanks,

Martin


2016-08-12  Martin Jambor  <mjam...@suse.cz>

        * ipa-hsa.c (process_hsa_functions): Copy externally visible flag
        to the node.
---
 gcc/ipa-hsa.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/ipa-hsa.c b/gcc/ipa-hsa.c
index 9ab4927..0fbe2e2 100644
--- a/gcc/ipa-hsa.c
+++ b/gcc/ipa-hsa.c
@@ -90,6 +90,7 @@ process_hsa_functions (void)
            = node->create_virtual_clone (vec <cgraph_edge *> (),
                                          NULL, NULL, "hsa");
          TREE_PUBLIC (clone->decl) = TREE_PUBLIC (node->decl);
+         clone->externally_visible = node->externally_visible;
 
          clone->force_output = true;
          hsa_summaries->link_functions (clone, node, s->m_kind, false);
@@ -107,6 +108,7 @@ process_hsa_functions (void)
            = node->create_virtual_clone (vec <cgraph_edge *> (),
                                          NULL, NULL, "hsa");
          TREE_PUBLIC (clone->decl) = TREE_PUBLIC (node->decl);
+         clone->externally_visible = node->externally_visible;
 
          if (!cgraph_local_p (node))
            clone->force_output = true;
-- 
2.9.2

Reply via email to