Fwd: heapvar_ids

Jan Hubicka jh@suse.cz
Thu Jan 18 08:39:00 GMT 2007


> On 1/17/07, Jan Hubicka <jh@suse.cz> wrote:
> >> Honza, i think you messed this one up recently.
> >> We have code in delete_tree_ssa that only delete's alias heapvars iff
> >> aliases were computed, but it's unconditionally initialized, so it
> >> should always be deleted.
> >>
> >> It *also* looks like you are now init'ing aliasing for every function
> >> at once in IPA mode. Is this true?
> >> if so, the heapvar_ids need to be moved to a gimple_df member :)
> >
> >Hi,
> >the initialization happens, because init_alias_heapvars is for some
> >reason called from init_ssa, that is called at IPA mode.
> >create_structure_vars is called late, so if heapvars was allocated at
> >that time, it would be handled correctly.
> >Is there any reason for allocating it early/are there some other
> >aliasing stuff I missed?
> Honestly, i can't rmember why we allocate it early.

Hi,
this patch should fix the problem (I still have memory corruption on
wave benchmark that seems related but honestly I don't have any idea
where it is comming from except that I when i disable structlias it
compiles.  There are 121 vops in tree-ssa-operands and somehow
it screws up, it just might be the hard limit on maximal number of
vops. Increasing the limits however don't seem to help and
I didn't make any further progress on this testcase yesterday night).

In this case I simply make init_alias_heapvars to be called from
may_alias and do nothing if previous may_alias already initialized it.
It is cleared from delete_ssa via delete_alias_heapvars.
Bootstrapped/regtested i686-linux, OK?

	* tree-ssa.c (init_tree_ssa): Do not call init_alias_heapvars.
	* tree-ssa-structalias.c (compute_points_to_sets): Do call
	init_alias_heapvars.
	(init_alias_heapvars): Initialize only when not already initialized.
	(delete_alias_heapvars): Set heapvar_for_stmt to NULL.
Index: tree-ssa.c
===================================================================
--- tree-ssa.c	(revision 120854)
+++ tree-ssa.c	(working copy)
@@ -778,7 +778,6 @@ init_tree_ssa (void)
 					       var_ann_eq, NULL);
   cfun->gimple_df->call_clobbered_vars = BITMAP_GGC_ALLOC ();
   cfun->gimple_df->addressable_vars = BITMAP_GGC_ALLOC ();
-  init_alias_heapvars ();
   init_ssanames ();
   init_phinodes ();
 }
Index: tree-ssa-structalias.c
===================================================================
--- tree-ssa-structalias.c	(revision 120854)
+++ tree-ssa-structalias.c	(working copy)
@@ -4247,6 +4251,7 @@ compute_points_to_sets (struct alias_inf
   timevar_push (TV_TREE_PTA);
 
   init_alias_vars ();
+  init_alias_heapvars ();
 
   intra_create_variable_infos ();
 
@@ -4467,14 +4477,16 @@ struct tree_opt_pass pass_ipa_pta =
 void
 init_alias_heapvars (void)
 {
-  heapvar_for_stmt = htab_create_ggc (11, tree_map_hash, tree_map_eq,
-				      NULL);
+  if (!heapvar_for_stmt)
+    heapvar_for_stmt = htab_create_ggc (11, tree_map_hash, tree_map_eq,
+					NULL);
 }
 
 void
 delete_alias_heapvars (void)
 {
   htab_delete (heapvar_for_stmt);
+  heapvar_for_stmt = NULL;
 }
 
 



More information about the Gcc-patches mailing list