tree fndecl;
struct cgraph_node *node;
- varpool_analyze_pending_decls ();
/* Note that this queue may grow as its being processed, as the new
functions may generate new ones. */
while (cgraph_new_nodes)
break;
}
cgraph_call_function_insertion_hooks (node);
- varpool_analyze_pending_decls ();
}
return output;
}
error ("Inline clone is needed");
error_found = true;
}
- for (e = node->indirect_calls; e; e = e->next_callee)
- {
- if (e->aux)
- {
- error ("aux field set for indirect edge from %s",
- identifier_to_locale (cgraph_node_name (e->caller)));
- error_found = true;
- }
- if (!e->indirect_unknown_callee
- || !e->indirect_info)
- {
- error ("An indirect edge from %s is not marked as indirect or has "
- "associated indirect_info, the corresponding statement is: ",
- identifier_to_locale (cgraph_node_name (e->caller)));
- debug_gimple_stmt (e->call_stmt);
- error_found = true;
- }
- }
for (e = node->callers; e; e = e->next_caller)
{
if (e->count < 0)
error ("double linked list of clones corrupted");
error_found = true;
}
- if (node->same_comdat_group)
- {
- struct cgraph_node *n = node->same_comdat_group;
-
- if (!DECL_ONE_ONLY (node->decl))
- {
- error ("non-DECL_ONE_ONLY node in a same_comdat_group list");
- error_found = true;
- }
- if (n == node)
- {
- error ("node is alone in a comdat group");
- error_found = true;
- }
- do
- {
- if (!n->same_comdat_group)
- {
- error ("same_comdat_group is not a circular list");
- error_found = true;
- break;
- }
- n = n->same_comdat_group;
- }
- while (n != node);
- }
if (node->analyzed && gimple_has_body_p (node->decl)
&& !TREE_ASM_WRITTEN (node->decl)
gsi_next (&gsi))
{
gimple stmt = gsi_stmt (gsi);
- if (is_gimple_call (stmt))
+ tree decl;
+ if (is_gimple_call (stmt) && (decl = gimple_call_fndecl (stmt)))
{
struct cgraph_edge *e = cgraph_edge (node, stmt);
- tree decl = gimple_call_fndecl (stmt);
if (e)
{
if (e->aux)
debug_gimple_stmt (stmt);
error_found = true;
}
- if (!e->indirect_unknown_callee)
+ if (e->callee->same_body_alias)
{
- if (e->callee->same_body_alias)
- {
- error ("edge points to same body alias:");
- debug_tree (e->callee->decl);
- error_found = true;
- }
- else if (!node->global.inlined_to
- && !e->callee->global.inlined_to
- && decl
- && !clone_of_p (cgraph_node (decl),
- e->callee))
- {
- error ("edge points to wrong declaration:");
- debug_tree (e->callee->decl);
- fprintf (stderr," Instead of:");
- debug_tree (decl);
- error_found = true;
- }
+ error ("edge points to same body alias:");
+ debug_tree (e->callee->decl);
+ error_found = true;
}
- else if (decl)
+ else if (!node->global.inlined_to
+ && !e->callee->global.inlined_to
+ && !clone_of_p (cgraph_node (decl), e->callee))
{
- error ("an indirect edge with unknown callee "
- "corresponding to a call_stmt with "
- "a known declaration:");
+ error ("edge points to wrong declaration:");
+ debug_tree (e->callee->decl);
+ fprintf (stderr," Instead of:");
+ debug_tree (decl);
error_found = true;
- debug_gimple_stmt (e->call_stmt);
}
e->aux = (void *)1;
}
- else if (decl)
+ else
{
error ("missing callgraph edge for call stmt:");
debug_gimple_stmt (stmt);
for (e = node->callees; e; e = e->next_callee)
{
- if (!e->aux)
+ if (!e->aux && !e->indirect_call)
{
error ("edge %s->%s has no corresponding call_stmt",
identifier_to_locale (cgraph_node_name (e->caller)),
}
e->aux = 0;
}
- for (e = node->indirect_calls; e; e = e->next_callee)
- {
- if (!e->aux)
- {
- error ("an indirect edge from %s has no corresponding call_stmt",
- identifier_to_locale (cgraph_node_name (e->caller)));
- debug_gimple_stmt (e->call_stmt);
- error_found = true;
- }
- e->aux = 0;
- }
}
if (error_found)
{
VEC(cgraph_edge_p,heap) *redirect_callers)
{
struct cgraph_node *new_version;
- struct cgraph_edge *e;
+ struct cgraph_edge *e, *new_e;
struct cgraph_edge *next_callee;
unsigned i;
also cloned. */
for (e = old_version->callees;e; e=e->next_callee)
{
- cgraph_clone_edge (e, new_version, e->call_stmt,
- e->lto_stmt_uid, REG_BR_PROB_BASE,
- CGRAPH_FREQ_BASE,
- e->loop_nest, true);
+ new_e = cgraph_clone_edge (e, new_version, e->call_stmt,
+ e->lto_stmt_uid, 0, e->frequency,
+ e->loop_nest, true);
+ new_e->count = e->count;
}
/* Fix recursive calls.
If OLD_VERSION has a recursive call after the