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, 4.1.2, 4.2.1, 4.3] Fix a bug in pointer dependency test


Ira Rosen wrote on 01/15/07 05:49:

+/* Given two tags return TRUE if their may-alias sets intersect.  */
+
+bool
+may_aliases_intersect (tree tag1, tree tag2)
+{
+  struct pointer_set_t *set1 = pointer_set_create ();
+  unsigned i;
+  VEC(tree,gc) *may_aliases1 = may_aliases (tag1);
+  VEC(tree,gc) *may_aliases2 = may_aliases (tag2);
+  tree sym;
+
+  /* Insert all the symbols from the first may-alias set into the
+     pointer-set.  */
+  for (i = 0; VEC_iterate (tree, may_aliases1, i, sym); i++)
+    pointer_set_insert (set1, sym);
+
+  /* Go through the second may-alias set and check if it contains symbols
that
+     are common with the first set.  */
+  for (i = 0; VEC_iterate (tree, may_aliases2, i, sym); i++)
+    if (pointer_set_contains (set1, sym))
+      {
+       pointer_set_destroy (set1);
+       return true;
+      }
+
+  pointer_set_destroy (set1);
+  return false;
+}
+
In mainline you no longer need this after Dan's bitmap conversion for
alias sets.

The rest is OK everywhere.


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