aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-07-15 12:01:07 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-07-15 10:01:07 +0000
commit99fecd47f16612cb53a936a7b6b82a6fdac3b84c (patch)
tree11277a792886817993fe98270d49a0e11e619778 /gcc/ipa.c
parent79c743005119639f4d30b82a708613a072e26681 (diff)
downloadgcc-99fecd47f16612cb53a936a7b6b82a6fdac3b84c.zip
gcc-99fecd47f16612cb53a936a7b6b82a6fdac3b84c.tar.gz
gcc-99fecd47f16612cb53a936a7b6b82a6fdac3b84c.tar.bz2
cgraph.c: Include lto-streamer.h
* cgraph.c: Include lto-streamer.h (change_decl_assembler_name): Work when assembler name hash is at place. (cgraph_make_decl_local): When localizing COMDAT symbol at WPA stage, be sure to rename it to avoid name clash. * ipa.c (cgraph_externally_visible_p, function_and_variable_visibility): Localize hidden symbols only when locally defined. From-SVN: r162211
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 785b4bd..4be3fcf 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -582,7 +582,10 @@ cgraph_externally_visible_p (struct cgraph_node *node, bool whole_program, bool
return true;
/* When doing link time optimizations, hidden symbols become local. */
- if (in_lto_p && DECL_VISIBILITY (node->decl) == VISIBILITY_HIDDEN)
+ if (in_lto_p && DECL_VISIBILITY (node->decl) == VISIBILITY_HIDDEN
+ /* Be sure that node is defined in IR file, not in other object
+ file. In that case we don't set used_from_other_object_file. */
+ && node->analyzed)
;
else if (!whole_program)
return true;
@@ -779,7 +782,10 @@ function_and_variable_visibility (bool whole_program)
/* When doing linktime optimizations, all hidden symbols will
become local. */
&& (!in_lto_p
- || DECL_VISIBILITY (vnode->decl) != VISIBILITY_HIDDEN))
+ || DECL_VISIBILITY (vnode->decl) != VISIBILITY_HIDDEN
+ /* We can get prevailing decision in other object file.
+ In this case we do not sed used_from_object_file. */
+ || !vnode->finalized))
|| vnode->used_from_object_file
|| pointer_set_contains (aliased_vnodes, vnode)
|| lookup_attribute ("externally_visible",