ebitmap.c: Change calls to verify_popcount with calls to sbitmap_verify_popcount.

2010-02-25  Nicolas Benoit  <nbenoit@tuxfamily.org>

	* ebitmap.c: Change calls to verify_popcount with calls to
	sbitmap_verify_popcount.
	(ebitmap_clear_bit): Fixed map->cacheindex test and
	map>cache update when bit clearing results in an empty
	element.

From-SVN: r157080
This commit is contained in:
Nicolas Benoit 2010-02-26 01:51:27 +00:00 committed by Diego Novillo
parent cac1c927c2
commit 4b9c607584
2 changed files with 22 additions and 9 deletions

View file

@ -1,3 +1,11 @@
2010-02-25 Nicolas Benoit <nbenoit@tuxfamily.org>
* ebitmap.c: Change calls to verify_popcount with calls to
sbitmap_verify_popcount.
(ebitmap_clear_bit): Fixed map->cacheindex test and
map>cache update when bit clearing results in an empty
element.
2010-02-25 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/43154

View file

@ -1,5 +1,5 @@
/* Sparse array-based bitmaps.
Copyright (C) 2007, 2008 Free Software Foundation, Inc.
Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Contributed by Daniel Berlin <dberlin@dberlin.org>
This file is part of GCC.
@ -254,8 +254,13 @@ ebitmap_clear_bit (ebitmap map, unsigned int bit)
if (!have_eltwordindex)
eltwordindex = sbitmap_popcount (map->wordmask, wordindex);
if (map->cache != NULL && map->cacheindex == eltwordindex)
map->cache = NULL;
if (map->cache != NULL)
{
if (map->cacheindex == wordindex)
map->cache = NULL;
else if (map->cacheindex > wordindex)
map->cache = map->cache - 1;
}
RESET_BIT (map->wordmask, wordindex);
@ -457,7 +462,7 @@ ebitmap_and_into (ebitmap dst, ebitmap src)
for (i = 0; i < dst->numwords; i++)
gcc_assert (dst->elts[i] != 0);
verify_popcount (dst->wordmask);
sbitmap_verify_popcount (dst->wordmask);
gcc_assert (sbitmap_popcount (dst->wordmask,
dst->wordmask->n_bits) == dst->numwords);
}
@ -529,7 +534,7 @@ ebitmap_and (ebitmap dst, ebitmap src1, ebitmap src2)
for (i = 0; i < dst->numwords; i++)
gcc_assert (dst->elts[i] != 0);
verify_popcount (dst->wordmask);
sbitmap_verify_popcount (dst->wordmask);
gcc_assert (sbitmap_popcount (dst->wordmask,
dst->wordmask->n_bits) == dst->numwords);
}
@ -652,7 +657,7 @@ ebitmap_ior_into (ebitmap dst, ebitmap src)
EXECUTE_IF_SET_IN_EBITMAP (dstcopy, 0, i, ebi)
gcc_assert (ebitmap_bit_p (dst, i));
verify_popcount (dst->wordmask);
sbitmap_verify_popcount (dst->wordmask);
gcc_assert (changed == !ebitmap_equal_p (dst, dstcopy));
gcc_assert (sbitmap_popcount (dst->wordmask,
dst->wordmask->n_bits) == dst->numwords);
@ -772,7 +777,7 @@ ebitmap_ior (ebitmap dst, ebitmap src1, ebitmap src2)
EXECUTE_IF_SET_IN_EBITMAP (src2, 0, i, ebi)
gcc_assert (ebitmap_bit_p (dst, i));
}
verify_popcount (dst->wordmask);
sbitmap_verify_popcount (dst->wordmask);
gcc_assert (changed == !ebitmap_equal_p (dst, dstcopy));
gcc_assert (sbitmap_popcount (dst->wordmask,
dst->wordmask->n_bits) == dst->numwords);
@ -848,7 +853,7 @@ ebitmap_and_compl_into (ebitmap dst, ebitmap src)
gcc_assert (sbitmap_popcount (dst->wordmask,
dst->wordmask->n_bits) == neweltindex);
verify_popcount (dst->wordmask);
sbitmap_verify_popcount (dst->wordmask);
gcc_assert (changed == !ebitmap_equal_p (dst, dstcopy));
gcc_assert (sbitmap_popcount (dst->wordmask,
dst->wordmask->n_bits) == dst->numwords);
@ -950,7 +955,7 @@ ebitmap_and_compl (ebitmap dst, ebitmap src1, ebitmap src2)
for (i = 0; i < dst->numwords; i++)
gcc_assert (dst->elts[i] != 0);
verify_popcount (dst->wordmask);
sbitmap_verify_popcount (dst->wordmask);
gcc_assert (sbitmap_popcount (dst->wordmask,
dst->wordmask->n_bits) == dst->numwords);
}