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: [PATCH]: Verify alias info faster



On Oct 12, 2004, at 1:41 PM, Diego Novillo wrote:


On Mon, 2004-10-11 at 20:40, Daniel Berlin wrote:

We could also verify this invariant, but i saw no reason to add that when
we never checked it before (I could add such a check if it is wanted).


Actually, the very reason that it was never checked is enough to add a
new check :)

Okeydokey.
I'll add it in a followup patch (I have the sinking feeling it may cause failures :( )




+/* Verify that all name tags have different points to sets.
+ This algorithm takes advantage of the fact that every variable with the
+ same name tag must have the same points-to set.
+ So we check a single variable for each name tag, and verify that it's


s/it's/its/

damn you apostrophe

+ points-to set is different from every other points-to set for other name
+ tags. */


+static void
+verify_name_tags (void)
+{
+  size_t i;
+  size_t j;
+  size_t num_name_tags = 0;
+  bitmap first, second;
+
+  VEC (tree) *name_tag_reps = NULL;
+  VEC (bitmap) *pt_vars_for_reps = NULL;
+  for (i = 0; i < num_ssa_names; i++)
+    {
+      if (ssa_name (i))
+	{
+	  tree ptr = ssa_name (i);
+	  struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr);
+	  if (!TREE_VISITED (ptr)
+	      || !POINTER_TYPE_P (TREE_TYPE (ptr))
+	      || !pi
+	      || !pi->name_mem_tag
+	      || TREE_VISITED (pi->name_mem_tag))
+	    continue;
+	  TREE_VISITED (pi->name_mem_tag) = 1;
+	  if (pi->pt_vars != NULL)
+	    {
+	      VEC_safe_push (tree, name_tag_reps, ptr);
+	      VEC_safe_push (bitmap, pt_vars_for_reps, pi->pt_vars);
+	    }
+	  num_name_tags++;
+
+	}
+    }

Leave 1 blank line between the various chunks of logic.  Makes the code
more readable.  Otherwise OK.


Will do.



Thanks. Diego.




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