backport: re PR lto/53572 (Some public symbols don't get to serialized LTO)

2012-09-07  Richard Guenther  <rguenther@suse.de>

	Backport from mainline
	2012-06-26  Jan Hubicka  <jh@suse.cz>

	PR lto/53572
	* cgraph.h (varpool_can_remove_if_no_refs): Fix handling of
	used symbols.

From-SVN: r191073
This commit is contained in:
Richard Guenther 2012-09-07 13:05:18 +00:00 committed by Richard Biener
parent 02cb06b808
commit 9cbd4f6899
2 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,12 @@
2012-09-07 Richard Guenther <rguenther@suse.de>
Backport from mainline
2012-06-26 Jan Hubicka <jh@suse.cz>
PR lto/53572
* cgraph.h (varpool_can_remove_if_no_refs): Fix handling of
used symbols.
2012-09-07 Richard Guenther <rguenther@suse.de>
Backport from mainline

View File

@ -946,10 +946,13 @@ 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->decl))
return true;
return (!node->force_output && !node->used_from_other_partition
&& (flag_toplevel_reorder || DECL_COMDAT (node->decl)
|| DECL_ARTIFICIAL (node->decl))
&& (DECL_COMDAT (node->decl) || !node->externally_visible));
&& ((DECL_COMDAT (node->decl)
&& !varpool_used_from_object_file_p (node))
|| !node->externally_visible
|| DECL_HAS_VALUE_EXPR_P (node->decl)));
}
/* Return true when all references to VNODE must be visible in ipa_ref_list.