Commit d3f2e41e by Jan Hubicka Committed by Jan Hubicka

ipa.c (symbol_table::remove_unreachable_nodes): Avoid releasing bodies of thunks; comment on why.

	* ipa.c (symbol_table::remove_unreachable_nodes): Avoid releasing
	bodies of thunks; comment on why.
	* symtab.c (symtab_node::get_partitioning_class): Aliases of extern
	symbols are extern.

From-SVN: r220630
parent 0a7d7e09
2015-02-11 Jan Hubicka <hubicka@ucw.cz>
* ipa.c (symbol_table::remove_unreachable_nodes): Avoid releasing
bodies of thunks; comment on why.
* symtab.c (symtab_node::get_partitioning_class): Aliases of extern
symbols are extern.
2015-02-11 Richard Henderson <rth@redhat.com> 2015-02-11 Richard Henderson <rth@redhat.com>
PR sanitize/65000 PR sanitize/65000
......
...@@ -537,7 +537,13 @@ symbol_table::remove_unreachable_nodes (FILE *file) ...@@ -537,7 +537,13 @@ symbol_table::remove_unreachable_nodes (FILE *file)
/* If node is unreachable, remove its body. */ /* If node is unreachable, remove its body. */
else if (!reachable.contains (node)) else if (!reachable.contains (node))
{ {
if (!body_needed_for_clonning.contains (node->decl)) /* We keep definitions of thunks and aliases in the boundary so
we can walk to the ultimate alias targets and function symbols
reliably. */
if (node->alias || node->thunk.thunk_p)
;
else if (!body_needed_for_clonning.contains (node->decl)
&& !node->alias && !node->thunk.thunk_p)
node->release_body (); node->release_body ();
else if (!node->clone_of) else if (!node->clone_of)
gcc_assert (in_lto_p || DECL_RESULT (node->decl)); gcc_assert (in_lto_p || DECL_RESULT (node->decl));
......
...@@ -1779,6 +1779,8 @@ symtab_node::get_partitioning_class (void) ...@@ -1779,6 +1779,8 @@ symtab_node::get_partitioning_class (void)
if (varpool_node *vnode = dyn_cast <varpool_node *> (this)) if (varpool_node *vnode = dyn_cast <varpool_node *> (this))
{ {
if (alias && definition && !ultimate_alias_target ()->definition)
return SYMBOL_EXTERNAL;
/* Constant pool references use local symbol names that can not /* Constant pool references use local symbol names that can not
be promoted global. We should never put into a constant pool be promoted global. We should never put into a constant pool
objects that can not be duplicated across partitions. */ objects that can not be duplicated across partitions. */
...@@ -1790,7 +1792,7 @@ symtab_node::get_partitioning_class (void) ...@@ -1790,7 +1792,7 @@ symtab_node::get_partitioning_class (void)
Handle them as external; compute_ltrans_boundary take care to make Handle them as external; compute_ltrans_boundary take care to make
proper things to happen (i.e. to make them appear in the boundary but proper things to happen (i.e. to make them appear in the boundary but
with body streamed, so clone can me materialized). */ with body streamed, so clone can me materialized). */
else if (!dyn_cast <cgraph_node *> (this)->definition) else if (!dyn_cast <cgraph_node *> (this)->function_symbol ()->definition)
return SYMBOL_EXTERNAL; return SYMBOL_EXTERNAL;
/* Linker discardable symbols are duplicated to every use unless they are /* Linker discardable symbols are duplicated to every use unless they are
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment