More lr problem bitmaps into its own obstack

Jan Hubicka hubicka@ucw.cz
Mon Jun 7 22:51:00 GMT 2010


> On Mon, Jun 7, 2010 at 9:20 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> >> --enable-checking=df is not enabled by default, and I am pretty sure
> >> that here leaving a dangling pointer that the next call to
> >> df_lr_verify_solution_start will happily use.
> >
> > Uh, thanks for pointing this out.  I never really worried from where that
> > df checking bits are used ;)
> > This is variant I comitted.  There was one extra problem
> > in updating df_lr_verify_solution_end: I need to check if verification
> > was initialized.
> >
> > Honza
> >
> >        * df-problems.c (df_lr_problem_data): Add lr_bitmaps.
> >        (df_lr_alloc): Initialize problem data; move bitmaps to
> >        lr_bitmaps obstack.
> >        (df_lr_finalize): Free problem data; do not bother to free bitmaps.
> >        (df_lr_verify_solution_start): Do not initialize problem data;
> >        allocate bitmaps in lr_bitmaps.
> >        (df_lr_verify_solution_end): Do not free problem data.
> >        * df-core.c (df_analyze_problem): Do verification after allocation.
> 
> 
> This caused:
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44454
> 
Hi,
the problem is that df_lr_top_dump/bottom_dump test presence of problem_data
to dump verification bitmaps.  Now problem_data is allocated always so we need
to check if the bitmaps are present.  This seems to fail depending on setup.

I've bootstrapped/regtested and comitted the following as obvious.

Honza

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 160409)
+++ ChangeLog	(working copy)
@@ -1,3 +1,9 @@
+2010-06-07  Jan Hubicka  <jh@suse.cz>
+
+	PR middle-end/44454
+	(df_lr_top_dump, df_lr_bottom_dump): Check that in/out bitmaps
+	are allocated.
+
 2010-06-07  Kaz Kojima  <kkojima@gcc.gnu.org>
 
 	* config/sh/sh.c (sh_build_builtin_va_list): Set tree type
Index: df-problems.c
===================================================================
--- df-problems.c	(revision 160382)
+++ df-problems.c	(working copy)
@@ -1120,8 +1120,11 @@ df_lr_top_dump (basic_block bb, FILE *fi
   if (df_lr->problem_data)
     {
       problem_data = (struct df_lr_problem_data *)df_lr->problem_data;
-      fprintf (file, ";;  old in  \t");
-      df_print_regset (file, &problem_data->in[bb->index]);
+      if (problem_data->in)
+	{
+      	  fprintf (file, ";;  old in  \t");
+      	  df_print_regset (file, &problem_data->in[bb->index]);
+	}
     }
   fprintf (file, ";; lr  use \t");
   df_print_regset (file, &bb_info->use);
@@ -1145,8 +1148,11 @@ df_lr_bottom_dump (basic_block bb, FILE 
   if (df_lr->problem_data)
     {
       problem_data = (struct df_lr_problem_data *)df_lr->problem_data;
-      fprintf (file, ";;  old out  \t");
-      df_print_regset (file, &problem_data->out[bb->index]);
+      if (problem_data->out)
+	{
+          fprintf (file, ";;  old out  \t");
+          df_print_regset (file, &problem_data->out[bb->index]);
+	}
     }
 }
 



More information about the Gcc-patches mailing list