On Wed, Oct 23, 2019 at 08:20:12PM +0200, Jan Hubicka wrote: > Hi, > this is variant of patch I comitted. It additionally register variable > removal hook to be sure that we do not mix up the static variable for > some other decl allocated later. > > Bootstrapped/regtested x86_64
This doesn't build. Completely untested patch to unbreak it is below, though not sure if it is enough. --- gcc/ipa-reference.c.jj 2019-10-23 20:38:01.392850897 +0200 +++ gcc/ipa-reference.c 2019-10-23 20:56:17.006239699 +0200 @@ -436,9 +436,9 @@ propagate_bits (ipa_reference_global_var static void varpool_removal_hook (varpool_node *node, void *) { - int *id = ipa_reference_vars_map->get (node->decl) + int *id = ipa_reference_vars_map->get (node->decl); if (id) - ipa_reference_vars_map->remove (*id); + ipa_reference_vars_map->remove (node->decl); } static bool ipa_init_p = false; @@ -455,7 +455,6 @@ ipa_init (void) vec_alloc (reference_vars_to_consider, 10); - if (ipa_ref_opt_sum_summaries != NULL) { delete ipa_ref_opt_sum_summaries; @@ -1051,7 +1050,6 @@ ipa_reference_write_optimization_summary } } - if (ltrans_statics_bitcount) for (i = 0; i < lto_symtab_encoder_size (encoder); i++) { @@ -1291,7 +1289,7 @@ ipa_reference_c_finalize (void) ipa_ref_opt_sum_summaries = NULL; delete ipa_reference_vars_map; ipa_reference_vars_map = NULL; - symtab->remove_varpool_removal_hook (varpool_node_hooks) + symtab->remove_varpool_removal_hook (varpool_node_hooks); } if (ipa_init_p) Jakub