diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2005-02-14 09:24:41 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2005-02-14 09:24:41 +0000 |
commit | 90bb1c1f1511ccb29fc3c23fe2ab871c24c6b040 (patch) | |
tree | 78f81c92bd77450f1528525aeae291d8e92e9486 /gcc | |
parent | be0f1e5478e1aba8e8231e6f42d60b096ba2726a (diff) | |
download | gcc-90bb1c1f1511ccb29fc3c23fe2ab871c24c6b040.zip gcc-90bb1c1f1511ccb29fc3c23fe2ab871c24c6b040.tar.gz gcc-90bb1c1f1511ccb29fc3c23fe2ab871c24c6b040.tar.bz2 |
bitmap.h (bitmap_and_compl_into): Return bool.
* bitmap.h (bitmap_and_compl_into): Return bool.
* bitmap.c (bitmap_and_compl_into): Return changed flag.
From-SVN: r95004
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/bitmap.c | 10 | ||||
-rw-r--r-- | gcc/bitmap.h | 2 |
3 files changed, 13 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 11dbcf7..c0a0e34 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 140dd00..7063f27 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 beb59d8..beb3f4a 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); |