aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-12-05 01:21:12 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2010-12-05 00:21:12 +0000
commitbf243ea70d6d2f7f7c0cb10144ed4ca88be66db8 (patch)
tree6c77de6e6dde1df685ac253d4609f568169d3ac4 /gcc/ipa.c
parent422ff5a2062922f3e587176ca031a4bb871eddf7 (diff)
downloadgcc-bf243ea70d6d2f7f7c0cb10144ed4ca88be66db8.zip
gcc-bf243ea70d6d2f7f7c0cb10144ed4ca88be66db8.tar.gz
gcc-bf243ea70d6d2f7f7c0cb10144ed4ca88be66db8.tar.bz2
ipa.c (cgraph_externally_visible_p): Do not localize builtins and functions with user asm defined names.
* ipa.c (cgraph_externally_visible_p): Do not localize builtins and functions with user asm defined names. (varpool_externally_visible_p): Do not localize vars with user asm defined names. From-SVN: r167465
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 0b6518b..5f39904 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -655,6 +655,22 @@ cgraph_externally_visible_p (struct cgraph_node *node, bool whole_program, bool
if (aliased)
return true;
+ /* Do not try to localize built-in functions yet. One of problems is that we
+ end up mangling their asm for WHOPR that makes it impossible to call them
+ using the implicit built-in declarations anymore. Similarly this enables
+ us to remove them as unreachable before actual calls may appear during
+ expansion or folding. */
+ if (DECL_BUILT_IN (node->decl))
+ return true;
+
+ /* FIXME: We get wrong symbols with asm aliases in callgraph and LTO.
+ This is because very little of code knows that assembler name needs to
+ mangled. Avoid touching declarations with user asm name set to mask
+ some of the problems. */
+ if (DECL_ASSEMBLER_NAME_SET_P (node->decl)
+ && IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->decl))[0]=='*')
+ return true;
+
/* If linker counts on us, we must preserve the function. */
if (cgraph_used_from_object_file_p (node))
return true;
@@ -721,6 +737,14 @@ varpool_externally_visible_p (struct varpool_node *vnode, bool aliased)
if (varpool_used_from_object_file_p (vnode))
return true;
+ /* FIXME: We get wrong symbols with asm aliases in callgraph and LTO.
+ This is because very little of code knows that assembler name needs to
+ mangled. Avoid touching declarations with user asm name set to mask
+ some of the problems. */
+ if (DECL_ASSEMBLER_NAME_SET_P (vnode->decl)
+ && IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (vnode->decl))[0]=='*')
+ return true;
+
if (DECL_PRESERVE_P (vnode->decl))
return true;
if (lookup_attribute ("externally_visible",