aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-02-11 20:11:47 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2015-02-11 19:11:47 +0000
commitd3f2e41eae66b3699aaa6e2bfc4ce5b86cedd37e (patch)
tree8ab6d8436aa96eaf64d3698bb24df0eaba1b0f19 /gcc/ipa.c
parent0a7d7e09c8e8aa2c79479e48bd4fee31dd0fe532 (diff)
downloadgcc-d3f2e41eae66b3699aaa6e2bfc4ce5b86cedd37e.zip
gcc-d3f2e41eae66b3699aaa6e2bfc4ce5b86cedd37e.tar.gz
gcc-d3f2e41eae66b3699aaa6e2bfc4ce5b86cedd37e.tar.bz2
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
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 620431c..58ba309 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));