+2011-04-19 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/46188
+ Backported from 4.6 branch
+ 2010-05-26 Jan Hubicka <jh@suse.cz>
+
+ * cgraphunit.c (clone_of_p): Remove.
+ (verify_cgraph_node): Do not verify clones.
+ (cgraph_materialize_all_clones): Do no redirection here.
+ * ipa-inline.c (inline_transform): Do redirection here.
+
2011-04-18 Eric Botcazou <ebotcazou@adacore.com>
* dwarf2out.c (is_redundant_typedef): Add 'inline' to prototype.
cgraph_mark_needed_node (node);
}
-/* Return TRUE if NODE2 is equivalent to NODE or its clone. */
-static bool
-clone_of_p (struct cgraph_node *node, struct cgraph_node *node2)
-{
- while (node != node2 && node2)
- node2 = node2->clone_of;
- return node2 != NULL;
-}
-
/* Verify cgraph nodes of given cgraph node. */
void
verify_cgraph_node (struct cgraph_node *node)
debug_tree (e->callee->decl);
error_found = true;
}
- else if (!node->global.inlined_to
- && !e->callee->global.inlined_to
- && !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;
- }
e->aux = (void *)1;
}
else
for (node = cgraph_nodes; node; node = node->next)
if (!node->analyzed && node->callees)
cgraph_node_remove_callees (node);
- if (cgraph_dump_file)
- fprintf (cgraph_dump_file, "Updating call sites\n");
- for (node = cgraph_nodes; node; node = node->next)
- if (node->analyzed && !node->clone_of
- && gimple_has_body_p (node->decl))
- {
- struct cgraph_edge *e;
-
- current_function_decl = node->decl;
- push_cfun (DECL_STRUCT_FUNCTION (node->decl));
- for (e = node->callees; e; e = e->next_callee)
- cgraph_redirect_edge_call_stmt_to_callee (e);
- pop_cfun ();
- current_function_decl = NULL;
-#ifdef ENABLE_CHECKING
- verify_cgraph_node (node);
-#endif
- }
if (cgraph_dump_file)
fprintf (cgraph_dump_file, "Materialization Call site updates done.\n");
- /* All changes to parameters have been performed. In order not to
- incorrectly repeat them, we simply dispose of the bitmaps that drive the
- changes. */
- for (node = cgraph_nodes; node; node = node->next)
- node->clone.combined_args_to_skip = NULL;
#ifdef ENABLE_CHECKING
verify_cgraph ();
#endif
{
unsigned int todo = 0;
struct cgraph_edge *e;
+ bool inline_p = false;
/* FIXME: Currently the passmanager is adding inline transform more than once to some
clones. This needs revisiting after WPA cleanups. */
save_inline_function_body (node);
for (e = node->callees; e; e = e->next_callee)
- if (!e->inline_failed || warn_inline)
- break;
+ {
+ cgraph_redirect_edge_call_stmt_to_callee (e);
+ if (!e->inline_failed || warn_inline)
+ inline_p = true;
+ }
- if (e)
+ if (inline_p)
{
timevar_push (TV_INTEGRATION);
todo = optimize_inline_calls (current_function_decl);