* bitmap.h (bitmap_and_compl_into): Return bool.
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Feb 2005 09:24:41 +0000 (09:24 +0000)
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Feb 2005 09:24:41 +0000 (09:24 +0000)
* bitmap.c (bitmap_and_compl_into): Return changed flag.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95004 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/bitmap.c
gcc/bitmap.h

index 11dbcf7..c0a0e34 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-13  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * bitmap.h (bitmap_and_compl_into): Return bool.
+       * bitmap.c (bitmap_and_compl_into): Return changed flag.
+
 2005-02-13  James A. Morrison  <phython@gcc.gnu.org>
 
        PR tree-optimization/19944
index 140dd00..7063f27 100644 (file)
@@ -700,14 +700,15 @@ bitmap_and_compl (bitmap dst, bitmap a, bitmap b)
     dst->indx = dst->current->indx;
 }
 
-/* A &= ~B */
+/* A &= ~B. Returns true if A changes */
 
-void
+bool
 bitmap_and_compl_into (bitmap a, bitmap b)
 {
   bitmap_element *a_elt = a->first;
   bitmap_element *b_elt = b->first;
   bitmap_element *next;
+  BITMAP_WORD changed = 0;
 
   gcc_assert (a != b);
   while (a_elt && b_elt)
@@ -724,9 +725,11 @@ bitmap_and_compl_into (bitmap a, bitmap b)
 
          for (ix = BITMAP_ELEMENT_WORDS; ix--;)
            {
-             BITMAP_WORD r = a_elt->bits[ix] & ~b_elt->bits[ix];
+             BITMAP_WORD cleared = a_elt->bits[ix] & b_elt->bits[ix];
+             BITMAP_WORD r = a_elt->bits[ix] ^ cleared;
 
              a_elt->bits[ix] = r;
+             changed |= cleared;
              ior |= r;
            }
          next = a_elt->next;
@@ -738,6 +741,7 @@ bitmap_and_compl_into (bitmap a, bitmap b)
     }
   gcc_assert (!a->current == !a->first);
   gcc_assert (!a->current || a->indx == a->current->indx);
+  return changed != 0;
 }
 
 /* DST = A | B.  Return true if DST changes.  */
index beb59d8..beb3f4a 100644 (file)
@@ -102,7 +102,7 @@ extern bool bitmap_intersect_compl_p (bitmap, bitmap);
 extern void bitmap_and (bitmap, bitmap, bitmap);
 extern void bitmap_and_into (bitmap, bitmap);
 extern void bitmap_and_compl (bitmap, bitmap, bitmap);
-extern void bitmap_and_compl_into (bitmap, bitmap);
+extern bool bitmap_and_compl_into (bitmap, bitmap);
 extern bool bitmap_ior (bitmap, bitmap, bitmap);
 extern bool bitmap_ior_into (bitmap, bitmap);
 extern void bitmap_xor (bitmap, bitmap, bitmap);