diff options
-rw-r--r-- | gcc/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/ipa-prop.c | 3 | ||||
-rw-r--r-- | gcc/ipa-reference.c | 11 | ||||
-rw-r--r-- | gcc/toplev.c | 4 |
4 files changed, 28 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 00edffe..3efe39e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,17 @@ 2014-12-04 David Malcolm <dmalcolm@redhat.com> + PR jit/63854 + * ipa-prop.c (ipa_register_cgraph_hooks): Guard insertion of + ipa_add_new_function on function_insertion_hook_holder being + non-NULL. + * ipa-reference.c (ipa_reference_c_finalize): Remove + node_removal_hook_holder and node_duplication_hook_holder if + they've been added to symtab. + * toplev.c (toplev::finalize): Call ipa_reference_c_finalize + before cgraph_c_finalize so that the former can access "symtab". + +2014-12-04 David Malcolm <dmalcolm@redhat.com> + * doc/cfg.texi (GIMPLE statement iterators): Add note about gphi_iterator, and use one in the example. * doc/gimple.texi (Tuple specific accessors): Add missing diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index c6e7868..eb83ae0 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -3613,7 +3613,8 @@ ipa_register_cgraph_hooks (void) if (!node_duplication_hook_holder) node_duplication_hook_holder = symtab->add_cgraph_duplication_hook (&ipa_node_duplication_hook, NULL); - function_insertion_hook_holder = + if (!function_insertion_hook_holder) + function_insertion_hook_holder = symtab->add_cgraph_insertion_hook (&ipa_add_new_function, NULL); } diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c index 1ce06d1..b046f9e 100644 --- a/gcc/ipa-reference.c +++ b/gcc/ipa-reference.c @@ -1198,4 +1198,15 @@ ipa_reference_c_finalize (void) bitmap_obstack_release (&optimization_summary_obstack); ipa_init_p = false; } + + if (node_removal_hook_holder) + { + symtab->remove_cgraph_removal_hook (node_removal_hook_holder); + node_removal_hook_holder = NULL; + } + if (node_duplication_hook_holder) + { + symtab->remove_cgraph_duplication_hook (node_duplication_hook_holder); + node_duplication_hook_holder = NULL; + } } diff --git a/gcc/toplev.c b/gcc/toplev.c index 2f547bf..911084d 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -2163,12 +2163,14 @@ toplev::finalize (void) rtl_initialized = false; this_target_rtl->target_specific_initialized = false; + /* Needs to be called before cgraph_c_finalize since it uses symtab. */ + ipa_reference_c_finalize (); + cgraph_c_finalize (); cgraphunit_c_finalize (); dwarf2out_c_finalize (); gcse_c_finalize (); ipa_cp_c_finalize (); - ipa_reference_c_finalize (); ira_costs_c_finalize (); params_c_finalize (); |