summaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-11 19:11:47 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-11 19:11:47 +0000
commit6cb8fb82f149ffca471ef2217144b19db1554344 (patch)
tree8ab6d8436aa96eaf64d3698bb24df0eaba1b0f19 /gcc/ipa.c
parentdb7b23e59ac4abf21d314a143d28dd151d4d74a3 (diff)
downloadgcc-6cb8fb82f149ffca471ef2217144b19db1554344.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220630 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 620431c54d6..58ba3097377 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -537,7 +537,13 @@ symbol_table::remove_unreachable_nodes (FILE *file)
/* If node is unreachable, remove its body. */
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 ();
else if (!node->clone_of)
gcc_assert (in_lto_p || DECL_RESULT (node->decl));