From aa419a527f91567691f226133efb0469b59359ac Mon Sep 17 00:00:00 2001 From: hubicka Date: Thu, 17 May 2012 16:37:33 +0000 Subject: * lto-symtab.c (lto_symtab_resolve_symbols): Preffer decl with constructor over decl without. * cgraph.c (cgraph_remove_node): Clear also body of unanalyzed nodes. * cgraph.h (varpool_can_remove_if_no_refs): Handle external correctly. * cgraphunit.c (process_function_and_variable_attributes): Finalize extrnal decls. (mark_functions_to_output): Also accept bodies for functions with clones. (output_in_order): Skip external vars. * lto-cgraph.c (lto_output_node): External functions are never in other partition. (lto_output_varpool_node): Likewise. * lto-streamer-out.c (lto_write_tree): Always use error_mark_nodes for forgotten initializers. * ipa.c (process_references): Handle external vars. (symtab_remove_unreachable_nodes): Update to handle external vars. (varpool_externally_visible_p): External vars are externally visible. * gimple-fold.c (can_refer_decl_in_current_unit_p): Update. * varpool.c (varpool_remove_node): Remove constructor. (decide_is_variable_needed): Handle externals. (varpool_remove_unreferenced_decls): Likewise. * lto-partition.c (add_references_to_partition): Handle external vars. (partition_varpool_node_p): Likewise. (lto_promote_cross_file_statics): Do not promote externals. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187631 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cgraph.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gcc/cgraph.h') diff --git a/gcc/cgraph.h b/gcc/cgraph.h index a4c23b35ec5..de854f74b01 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -1123,11 +1123,12 @@ cgraph_only_called_directly_or_aliased_p (struct cgraph_node *node) static inline bool varpool_can_remove_if_no_refs (struct varpool_node *node) { + if (DECL_EXTERNAL (node->symbol.decl)) + return true; return (!node->symbol.force_output && !node->symbol.used_from_other_partition && (DECL_COMDAT (node->symbol.decl) - || !node->symbol.externally_visible - || DECL_HAS_VALUE_EXPR_P (node->symbol.decl) - || DECL_EXTERNAL (node->symbol.decl))); + || !node->symbol.externally_visible + || DECL_HAS_VALUE_EXPR_P (node->symbol.decl))); } /* Return true when all references to VNODE must be visible in ipa_ref_list. -- cgit v1.2.1