summaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-02 22:19:37 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-02 22:19:37 +0000
commit36a3e498a9fb25ea1c9344f1bb87e4093e60a954 (patch)
tree5e8cb9726985c6860c6d592db3fc1617ee95291e /gcc/ipa.c
parente40323639ede479a58d6575ea770d664e5c6134c (diff)
downloadgcc-36a3e498a9fb25ea1c9344f1bb87e4093e60a954.tar.gz
PR ipa/60150
* ipa.c (function_and_variable_visibility): When dissolving comdat group, also set all symbols to local. * g++.dg/lto/pr60150.H: New testcase. * g++.dg/lto/pr60150_0.C: New testcase. * g++.dg/lto/pr60150_1.C: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208262 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 405ee644c36..da9755425c5 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -970,15 +970,32 @@ function_and_variable_visibility (bool whole_program)
gcc_assert (whole_program || in_lto_p
|| !TREE_PUBLIC (node->decl));
node->unique_name = ((node->resolution == LDPR_PREVAILING_DEF_IRONLY
- || node->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP)
- && TREE_PUBLIC (node->decl));
+ || node->unique_name
+ || node->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP)
+ && TREE_PUBLIC (node->decl));
node->resolution = LDPR_PREVAILING_DEF_IRONLY;
if (node->same_comdat_group && TREE_PUBLIC (node->decl))
- /* cgraph_externally_visible_p has already checked all other nodes
- in the group and they will all be made local. We need to
- dissolve the group at once so that the predicate does not
- segfault though. */
- symtab_dissolve_same_comdat_group_list (node);
+ {
+ symtab_node *next = node;
+
+ /* Set all members of comdat group local. */
+ if (node->same_comdat_group)
+ for (next = node->same_comdat_group;
+ next != node;
+ next = next->same_comdat_group)
+ {
+ symtab_make_decl_local (next->decl);
+ next->unique_name = ((next->resolution == LDPR_PREVAILING_DEF_IRONLY
+ || next->unique_name
+ || next->resolution == LDPR_PREVAILING_DEF_IRONLY_EXP)
+ && TREE_PUBLIC (next->decl));
+ }
+ /* cgraph_externally_visible_p has already checked all other nodes
+ in the group and they will all be made local. We need to
+ dissolve the group at once so that the predicate does not
+ segfault though. */
+ symtab_dissolve_same_comdat_group_list (node);
+ }
symtab_make_decl_local (node->decl);
}