summaryrefslogtreecommitdiff
path: root/gcc/bitmap.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-14 09:24:41 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-14 09:24:41 +0000
commit0db4e233fa979b96c33eae9a0b7d1c50fa2d1075 (patch)
tree78f81c92bd77450f1528525aeae291d8e92e9486 /gcc/bitmap.c
parentbb30d1f4b425d77cdca39914443b3de84ed22f00 (diff)
downloadgcc-0db4e233fa979b96c33eae9a0b7d1c50fa2d1075.tar.gz
* bitmap.h (bitmap_and_compl_into): Return bool.
* 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
Diffstat (limited to 'gcc/bitmap.c')
-rw-r--r--gcc/bitmap.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index 140dd007e79..7063f27b732 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -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. */