From patchwork Thu Jun 10 23:23:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Move df_live and df_md bitmaps to own obstacks Date: Thu, 10 Jun 2010 13:23:07 -0000 From: "H.J. Lu" X-Patchwork-Id: 55277 Message-Id: To: Jan Hubicka Cc: gcc-patches@gcc.gnu.org, bonzini@gnu.org On Thu, Jun 10, 2010 at 3:41 PM, H.J. Lu wrote: > On Thu, Jun 10, 2010 at 4:35 AM, Jan Hubicka wrote: >> Hi, >> this patch moves df_live and df_md bitmaps to own obstacks.  I believe those >> are all important df problems that depends on bitmap performance? >> >> Bootstrapped/regtested x86_64-linux (with df checking) >> OK? >> >> Honza >> >>        * df-problems.c (df_live_problem_data): Add live_bitmaps. >>        (df_live_alloc): Initialize problem data and live_osbtacks. >>        (df_live_finalize): Remove obstack, problem data; do not >>        clear all bitmaps. >>        (df_live_top_dump, df_live_bottom_dump): Do not dump old >>        data when not allocated. >>        (df_live_verify_solution_start): Do not allocate problem data. >>        (df_live_verify_solution_end): Check if out is allocated. >>        (struct df_md_problem_data): New structure. >>        (df_md_alloc): Allocate problem data. >>        (df_md_free): Free problem data; do not clear bitmaps. >> > > This caused: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44498 > 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; } BITMAP_FREE (df_live->out_of_date_transfer_functions); free (df_live);