Hi, when ipa-icf produces wrapper/alias it needs to also update summaries to represent the new function body. W/o this propagation across new wrappers does not work.
Bootstrapped/regtested x86_64-linux, will commit it shortly. * ipa-icf.c (sem_function::merge): Update function summaries. * ipa-prop.h (ipa_get_param): Do not sanity check for WPA. Index: ipa-icf.c =================================================================== --- ipa-icf.c (revision 277474) +++ ipa-icf.c (working copy) @@ -1266,6 +1266,7 @@ sem_function::merge (sem_item *alias_ite /* Remove the function's body. */ ipa_merge_profiles (original, alias); + symtab->call_cgraph_removal_hooks (alias); alias->release_body (true); alias->reset (); /* Notice global symbol possibly produced RTL. */ @@ -1287,11 +1288,13 @@ sem_function::merge (sem_item *alias_ite { gcc_assert (!create_alias); alias->icf_merged = true; + symtab->call_cgraph_removal_hooks (alias); local_original->icf_merged = true; /* FIXME update local_original counts. */ ipa_merge_profiles (original, alias, true); alias->create_wrapper (local_original); + symtab->call_cgraph_insertion_hooks (alias); if (dump_enabled_p ()) dump_printf (MSG_OPTIMIZED_LOCATIONS, Index: ipa-prop.h =================================================================== --- ipa-prop.h (revision 277474) +++ ipa-prop.h (working copy) @@ -457,7 +457,6 @@ static inline tree ipa_get_param (class ipa_node_params *info, int i) { gcc_checking_assert (info->descriptors); - gcc_checking_assert (!flag_wpa); tree t = (*info->descriptors)[i].decl_or_type; gcc_checking_assert (TREE_CODE (t) == PARM_DECL); return t;