diff options
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r-- | gcc/ipa.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c index 9cbd2da8023..620431c54d6 100644 --- a/gcc/ipa.c +++ b/gcc/ipa.c @@ -383,7 +383,11 @@ symbol_table::remove_unreachable_nodes (FILE *file) /* If we are processing symbol in boundary, mark its AUX pointer for possible later re-processing in enqueue_node. */ if (in_boundary_p) - node->aux = (void *)2; + { + node->aux = (void *)2; + if (node->alias && node->analyzed) + enqueue_node (node->get_alias_target (), &first, &reachable); + } else { if (TREE_CODE (node->decl) == FUNCTION_DECL @@ -486,6 +490,9 @@ symbol_table::remove_unreachable_nodes (FILE *file) } } + else if (cnode->thunk.thunk_p) + enqueue_node (cnode->callees->callee, &first, &reachable); + /* If any reachable function has simd clones, mark them as reachable as well. */ if (cnode->simd_clones) @@ -534,7 +541,7 @@ symbol_table::remove_unreachable_nodes (FILE *file) node->release_body (); else if (!node->clone_of) gcc_assert (in_lto_p || DECL_RESULT (node->decl)); - if (node->definition) + if (node->definition && !node->alias && !node->thunk.thunk_p) { if (file) fprintf (file, " %s/%i", node->name (), node->order); @@ -554,7 +561,6 @@ symbol_table::remove_unreachable_nodes (FILE *file) if (!node->in_other_partition) node->local.local = false; node->remove_callees (); - node->remove_from_same_comdat_group (); node->remove_all_references (); changed = true; if (node->thunk.thunk_p @@ -614,7 +620,7 @@ symbol_table::remove_unreachable_nodes (FILE *file) vnode->remove (); changed = true; } - else if (!reachable.contains (vnode)) + else if (!reachable.contains (vnode) && !vnode->alias) { tree init; if (vnode->definition) |