summaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-09 03:33:44 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-09 03:33:44 +0000
commitdabebf7ecc90b59b0603d2428cf465fe1f0d642b (patch)
tree91cf7e9a3eeaae34dd4f07d9086f498096305f0d /gcc/ipa.c
parent63aa3890e81a12aaac274e04e4967bb4abfb7d7a (diff)
downloadgcc-dabebf7ecc90b59b0603d2428cf465fe1f0d642b.tar.gz
gcc/
* cgraph.c (cgraph_add_to_same_comdat_group): New. * cgraph.h: Declare it. * ipa.c (function_and_variable_visibility): Make sure thunks have the right visibility. gcc/cp/ * method.c (use_thunk): Use cgraph_add_to_same_comdat_group. * optimize.c (maybe_clone_body): Likewise. * semantics.c (maybe_add_lambda_conv_op): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176071 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 5b09250d661..9d54811e5c9 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -865,31 +865,14 @@ function_and_variable_visibility (bool whole_program)
decl_node = cgraph_function_node (decl_node->callees->callee, NULL);
/* Thunks have the same visibility as function they are attached to.
- For some reason C++ frontend don't seem to care. I.e. in
- g++.dg/torture/pr41257-2.C the thunk is not comdat while function
- it is attached to is.
-
- We also need to arrange the thunk into the same comdat group as
- the function it reffers to. */
+ Make sure the C++ front end set this up properly. */
if (DECL_ONE_ONLY (decl_node->decl))
{
- DECL_COMDAT (node->decl) = DECL_COMDAT (decl_node->decl);
- DECL_COMDAT_GROUP (node->decl) = DECL_COMDAT_GROUP (decl_node->decl);
- if (DECL_ONE_ONLY (decl_node->decl) && !node->same_comdat_group)
- {
- node->same_comdat_group = decl_node;
- if (!decl_node->same_comdat_group)
- decl_node->same_comdat_group = node;
- else
- {
- struct cgraph_node *n;
- for (n = decl_node->same_comdat_group;
- n->same_comdat_group != decl_node;
- n = n->same_comdat_group)
- ;
- n->same_comdat_group = node;
- }
- }
+ gcc_checking_assert (DECL_COMDAT (node->decl)
+ == DECL_COMDAT (decl_node->decl));
+ gcc_checking_assert (DECL_COMDAT_GROUP (node->decl)
+ == DECL_COMDAT_GROUP (decl_node->decl));
+ gcc_checking_assert (node->same_comdat_group);
}
if (DECL_EXTERNAL (decl_node->decl))
DECL_EXTERNAL (node->decl) = 1;