aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2014-05-19 03:01:12 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2014-05-19 01:01:12 +0000
commit7b3376a0da3e5de61c15899e4da1fc03ef7438d0 (patch)
treeba76d5a126b19a9883d7c963376b2cffd9f0d6a1 /gcc/ipa.c
parenta04d9035ec03996fd6f96a1ece21bc8d4c54cd40 (diff)
downloadgcc-7b3376a0da3e5de61c15899e4da1fc03ef7438d0.zip
gcc-7b3376a0da3e5de61c15899e4da1fc03ef7438d0.tar.gz
gcc-7b3376a0da3e5de61c15899e4da1fc03ef7438d0.tar.bz2
ipa.c (symtab_remove_unreachable_nodes): Remove symbol from comdat group if its body was eliminated.
* ipa.c (symtab_remove_unreachable_nodes): Remove symbol from comdat group if its body was eliminated. (comdat_can_be_unshared_p_1): Static symbols can always be privatized. * symtab.c (symtab_remove_from_same_comdat_group): Break out from ... (symtab_unregister_node): ... this one. (verify_symtab_base): More strict checking of comdats. * cgraph.h (symtab_remove_from_same_comdat_group): Declare. From-SVN: r210598
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index ef54461..9c88fe4 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -517,6 +517,7 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
if (!node->in_other_partition)
node->local.local = false;
cgraph_node_remove_callees (node);
+ symtab_remove_from_same_comdat_group (node);
ipa_remove_all_references (&node->ref_list);
changed = true;
}
@@ -572,6 +573,8 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
vnode->analyzed = false;
vnode->aux = NULL;
+ symtab_remove_from_same_comdat_group (vnode);
+
/* Keep body if it may be useful for constant folding. */
if ((init = ctor_for_folding (vnode->decl)) == error_mark_node)
varpool_remove_initializer (vnode);
@@ -776,6 +779,8 @@ address_taken_from_non_vtable_p (symtab_node *node)
static bool
comdat_can_be_unshared_p_1 (symtab_node *node)
{
+ if (!node->externally_visible)
+ return true;
/* When address is taken, we don't know if equality comparison won't
break eventually. Exception are virutal functions, C++
constructors/destructors and vtables, where this is not possible by