http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48752
--- Comment #13 from Jan Hubicka <hubicka at ucw dot cz> 2011-04-27 07:46:00
UTC ---
Hi,
this patch is not really tested, I need to construct a testcase that reproduces
fo rme, but it
adds the mising add_new_function hook and should solve the problem.
Honza
Index: ipa-prop.c
===================================================================
*** ipa-prop.c (revision 172989)
--- ipa-prop.c (working copy)
*************** static struct cgraph_edge_hook_list *edg
*** 63,68 ****
--- 63,69 ----
static struct cgraph_node_hook_list *node_removal_hook_holder;
static struct cgraph_2edge_hook_list *edge_duplication_hook_holder;
static struct cgraph_2node_hook_list *node_duplication_hook_holder;
+ static struct cgraph_node_hook_list *function_insertion_hook_holder;
/* Add cgraph NODE described by INFO to the worklist WL regardless of whether
it is in one or not. It should almost never be used directly, as opposed
to
*************** ipa_node_duplication_hook (struct cgraph
*** 2058,2063 ****
--- 2059,2073 ----
new_info->node_enqueued = old_info->node_enqueued;
}
+
+ /* Analyze newly added function into callgraph. */
+
+ static void
+ ipa_add_new_function (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
+ {
+ ipa_analyze_node (node);
+ }
+
/* Register our cgraph hooks if they are not already there. */
void
*************** ipa_register_cgraph_hooks (void)
*** 2075,2080 ****
--- 2085,2092 ----
if (!node_duplication_hook_holder)
node_duplication_hook_holder =
cgraph_add_node_duplication_hook (&ipa_node_duplication_hook, NULL);
+ function_insertion_hook_holder =
+ cgraph_add_function_insertion_hook (&ipa_add_new_function, NULL);
}
/* Unregister our cgraph hooks if they are not already there. */
*************** ipa_unregister_cgraph_hooks (void)
*** 2090,2095 ****
--- 2102,2109 ----
edge_duplication_hook_holder = NULL;
cgraph_remove_node_duplication_hook (node_duplication_hook_holder);
node_duplication_hook_holder = NULL;
+ cgraph_remove_function_insertion_hook (function_insertion_hook_holder);
+ function_insertion_hook_holder = NULL;
}
/* Allocate all necessary data structures necessary for indirect inlining.
*/