aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-05-22 16:48:40 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-05-22 14:48:40 +0000
commit9f90e80a1823bfb50fdbdac0eae44205fc436e56 (patch)
treec6700f8a244d310bf2e05c428d125caeecbd1ffe /gcc/ipa.c
parenta2c9fe42531a2ef2259e4128c50632b2df37202b (diff)
downloadgcc-9f90e80a1823bfb50fdbdac0eae44205fc436e56.zip
gcc-9f90e80a1823bfb50fdbdac0eae44205fc436e56.tar.gz
gcc-9f90e80a1823bfb50fdbdac0eae44205fc436e56.tar.bz2
decl2.c (maybe_emit_vtables): Produce same comdat group when outputting comdat vtables.
* decl2.c (maybe_emit_vtables): Produce same comdat group when outputting comdat vtables. (cxx_callgraph_analyze_expr): Remove code marking vtables needed. * cgraph.h (struct varpool_node): Add same_comdat_group. * lto-cgrpah.c (lto_output_varpool_node): Output same_comdat_group pointer. (output_varpool): Update call of lto_output_varpool_node. (input_varpool): Read same_comdat_group pointer. (input_varpool_1): Fixup same_comdat_group pointer. * ipa.c (cgraph_remove_unreachable_nodes): WHen one of same comdat group is needed, all are. * varpool.c (varpool_remove_node): Remove node from same comdat group linklist too. (varpool_analyze_pending_decls): Walk same comdat groups. From-SVN: r159699
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index c8b0d7b..319a3f1 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -334,6 +334,21 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
first_varpool = (struct varpool_node *)first_varpool->aux;
vnode->aux = NULL;
process_references (&vnode->ref_list, &first, &first_varpool, before_inlining_p);
+ /* If any function in a comdat group is reachable, force
+ all other functions in the same comdat group to be
+ also reachable. */
+ if (vnode->same_comdat_group)
+ {
+ struct varpool_node *next;
+ for (next = vnode->same_comdat_group;
+ next != vnode;
+ next = next->same_comdat_group)
+ if (!next->needed)
+ {
+ varpool_mark_needed_node (next);
+ enqueue_varpool_node (next, &first_varpool);
+ }
+ }
}
}