aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/ipa.c
diff options
context:
space:
mode:
authorYiran Wang <yiran@google.com>2015-06-23 15:33:17 -0700
committerYiran Wang <yiran@google.com>2015-06-29 10:56:28 -0700
commit1d9fec7937f45dde5e04cac966a2d9a12f2fc15a (patch)
tree3fbcd18a379a05fd6d43491a107e1f36bc61b185 /gcc-4.9/gcc/ipa.c
parentf378ebf14df0952eae870c9865bab8326aa8f137 (diff)
downloadtoolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.gz
toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.tar.bz2
toolchain_gcc-1d9fec7937f45dde5e04cac966a2d9a12f2fc15a.zip
Synchronize with google/gcc-4_9 to r224707 (from r214835)
Change-Id: I3d6f06fc613c8f8b6a82143dc44b7338483aac5d
Diffstat (limited to 'gcc-4.9/gcc/ipa.c')
-rw-r--r--gcc-4.9/gcc/ipa.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/gcc-4.9/gcc/ipa.c b/gcc-4.9/gcc/ipa.c
index 5a0b199ff..5d2465c83 100644
--- a/gcc-4.9/gcc/ipa.c
+++ b/gcc-4.9/gcc/ipa.c
@@ -388,9 +388,17 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file)
&& DECL_ABSTRACT_ORIGIN (node->decl))
{
struct cgraph_node *origin_node
- = cgraph_get_create_node (DECL_ABSTRACT_ORIGIN (node->decl));
- origin_node->used_as_abstract_origin = true;
- enqueue_node (origin_node, &first, reachable);
+ = cgraph_get_node (DECL_ABSTRACT_ORIGIN (node->decl));
+ if (origin_node && !origin_node->used_as_abstract_origin)
+ {
+ origin_node->used_as_abstract_origin = true;
+ gcc_assert (!origin_node->prev_sibling_clone);
+ gcc_assert (!origin_node->next_sibling_clone);
+ for (cgraph_node *n = origin_node->clones; n;
+ n = n->next_sibling_clone)
+ if (n->decl == DECL_ABSTRACT_ORIGIN (node->decl))
+ n->used_as_abstract_origin = true;
+ }
}
/* If any symbol in a comdat group is reachable, force
all externally visible symbols in the same comdat
@@ -1146,12 +1154,15 @@ function_and_variable_visibility (bool whole_program)
if (node->callers && can_replace_by_local_alias (node))
{
struct cgraph_node *alias = cgraph (symtab_nonoverwritable_alias (node));
+ struct cgraph_edge *e, *next_caller;
if (alias && alias != node)
{
- while (node->callers)
+ for (e = node->callers; e; e = next_caller)
{
- struct cgraph_edge *e = node->callers;
+ next_caller = e->next_caller;
+ if (L_IPO_COMP_MODE && cgraph_is_fake_indirect_call_edge (e))
+ continue;
cgraph_redirect_edge_callee (e, alias);
if (gimple_has_body_p (e->caller->decl))