Hi,

I've spotted a likely typo:

On Thu, Jul 09, 2015 at 11:13:53AM +0200, Martin Liska wrote:
> gcc/ChangeLog:
> 
> 2015-07-03  Martin Liska  <mli...@suse.cz>
> 
>       * ipa-reference.c (ipa_ref_opt_summary_t): New class.
>       (get_reference_optimization_summary): Use it.
>       (set_reference_optimization_summary): Likewise.
>       (ipa_init): Remove hook holders usage.
>       (ipa_reference_c_finalize): Likewise.
>       (ipa_ref_opt_summary_t::duplicate): New function.
>       (ipa_ref_opt_summary_t::remove): Likewise.
>       (propagate): Allocate the summary if does not exist.
>       (ipa_reference_read_optimization_summary): Likewise.
>       (struct ipa_reference_vars_info_d): Add new method.
>       (struct ipa_reference_optimization_summary_d): Likewise.
>       (get_reference_vars_info): Use new underlying container.
>       (set_reference_vars_info): Remove.
>       (init_function_info): Set up the container.
> ---
>  gcc/ipa-reference.c | 203 
> ++++++++++++++++++++++++++--------------------------
>  1 file changed, 102 insertions(+), 101 deletions(-)
> 
> diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c
> index 465a74b..2afd9ad 100644
> --- a/gcc/ipa-reference.c
> +++ b/gcc/ipa-reference.c

...

> @@ -837,12 +839,14 @@ propagate (void)
>       }
>      }
>  
> +  if (ipa_ref_opt_sum_summaries == NULL)
> +    ipa_ref_opt_sum_summaries = new ipa_ref_opt_summary_t (symtab);
> +
>    /* Cleanup. */
>    FOR_EACH_DEFINED_FUNCTION (node)
>      {
>        ipa_reference_vars_info_t node_info;
>        ipa_reference_global_vars_info_t node_g;
> -      ipa_reference_optimization_summary_t opt;
>  
>        node_info = get_reference_vars_info (node);
>        if (!node->alias && opt_for_fn (node->decl, flag_ipa_reference)
> @@ -851,8 +855,8 @@ propagate (void)
>       {
>         node_g = &node_info->global;
>  
> -       opt = XCNEW (struct ipa_reference_optimization_summary_d);
> -       set_reference_optimization_summary (node, opt);
> +       ipa_reference_optimization_summary_d *opt =
> +         ipa_ref_opt_sum_summaries->get (node);
>  
>         /* Create the complimentary sets.  */
>  
> @@ -880,14 +884,20 @@ propagate (void)
>                                 node_g->statics_written);
>           }
>       }
> -      free (node_info);
>     }
>  
>    ipa_free_postorder_info ();
>    free (order);
>  
>    bitmap_obstack_release (&local_info_obstack);
> -  ipa_reference_vars_vector.release ();
> +
> +  if (ipa_ref_var_info_summaries == NULL)

I assume you meant != NULL here.

> +    {
> +      delete ipa_ref_var_info_summaries;
> +      ipa_ref_var_info_summaries = NULL;
> +    }
> +
> +  ipa_ref_var_info_summaries = NULL;
>    if (dump_file)
>      splay_tree_delete (reference_vars_to_consider);
>    reference_vars_to_consider = NULL;

Thanks,

Martin

Reply via email to