summaryrefslogtreecommitdiff
path: root/gcc/ebitmap.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-03 13:51:26 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-03 13:51:26 +0000
commit8713644151ea92118e5d818b87c1eafc31eb14d9 (patch)
treef935059d4f4719a4a188bfdb5dd38f0ea3d57064 /gcc/ebitmap.c
parent4b7210115bb4b35bf4af1d9c9e077a61baeb602f (diff)
downloadgcc-8713644151ea92118e5d818b87c1eafc31eb14d9.tar.gz
2010-03-03 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 157193 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@157194 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ebitmap.c')
-rw-r--r--gcc/ebitmap.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/gcc/ebitmap.c b/gcc/ebitmap.c
index 472ff2e57ae..64c563487cf 100644
--- a/gcc/ebitmap.c
+++ b/gcc/ebitmap.c
@@ -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);
}