This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Move df_live and df_md bitmaps to own obstacks


On Thu, Jun 10, 2010 at 04:23:07PM -0700, H.J. Lu wrote:
> We have
> 
> 
>    if (!df_live_scratch)
> -    df_live_scratch = BITMAP_ALLOC (NULL);
> +    df_live_scratch = BITMAP_ALLOC (&problem_data->live_bitmaps);
> ...
> +      bitmap_obstack_release (&problem_data->live_bitmaps);
> 
>        if (df_live_scratch)
>         BITMAP_FREE (df_live_scratch);
> 
> We are calling bitmap_obstack_free after bitmap_obstack_release is called. Does
> this patch make any senses?
> 
> 
> Index: df-problems.c
> ===================================================================
> --- df-problems.c	(revision 160549)
> +++ df-problems.c	(working copy)
> @@ -1645,8 +1645,8 @@ df_live_free (void)
>        free (df_live->block_info);
>        bitmap_obstack_release (&problem_data->live_bitmaps);
> 
> -      if (df_live_scratch)
> -	BITMAP_FREE (df_live_scratch);
> +      /* df_live_scratch is allocated from problem_data->live_bitmaps.  */
> +      df_live_scratch = (bitmap) NULL;

Wouldn't it be better to move that
if (df_live_scratch)
  BITMAP_FREE (df_live_scratch);
before bitmap_obstack_release?  BITMAP_FREE is pretty cheap operation
and if you don't do it, the statistics won't be updated.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]