aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2005-02-14 09:24:41 +0000
committerNathan Sidwell <nathan@codesourcery.com>2005-02-14 09:24:41 +0000
commita92e878cbb848cb69dd2f3fdd77802ef029a0c9c (patch)
tree78f81c92bd77450f1528525aeae291d8e92e9486
parentbcfb93e2e17168325111a0d4d51f045170ae0579 (diff)
* bitmap.h (bitmap_and_compl_into): Return bool.
* bitmap.c (bitmap_and_compl_into): Return changed flag. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@95004 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/bitmap.c10
-rw-r--r--gcc/bitmap.h2
3 files changed, 13 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 11dbcf766e7..c0a0e34fe82 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
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. */
diff --git a/gcc/bitmap.h b/gcc/bitmap.h
index beb59d85f86..beb3f4a1578 100644
--- a/gcc/bitmap.h
+++ b/gcc/bitmap.h
@@ -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);