diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-10-04 18:39:19 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-10-04 18:39:19 +0000 |
commit | 4076a36785416c4bc31a1bf530cbd266e9f7a6e4 (patch) | |
tree | 3e752ed8fedf827fbcb5fb994aa11957817cc386 /gcc/sbitmap.c | |
parent | 460acfe420f271238ab31eab7dbf152f82d285a2 (diff) | |
download | gcc-4076a36785416c4bc31a1bf530cbd266e9f7a6e4.tar.gz |
* sbitmap.c (sbitmap_ones): Don't set too many bits.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29807 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sbitmap.c')
-rw-r--r-- | gcc/sbitmap.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c index 89d6600927d..8aae23aac64 100644 --- a/gcc/sbitmap.c +++ b/gcc/sbitmap.c @@ -115,7 +115,16 @@ void sbitmap_ones (bmap) sbitmap bmap; { + unsigned int last_bit; + memset (bmap->elms, -1, bmap->bytes); + + last_bit = bmap->n_bits % (unsigned) SBITMAP_ELT_BITS; + if (last_bit) + { + bmap->elms[bmap->size - 1] + = (SBITMAP_ELT_TYPE)-1 >> (SBITMAP_ELT_BITS - last_bit); + } } /* Zero a vector of N_VECS bitmaps. */ @@ -208,7 +217,7 @@ sbitmap_difference (dst, a, b) *dstp++ = *ap++ & (~*bp++); } -/* Set DST to be (A and B)). +/* Set DST to be (A and B). Return non-zero if any change is made. */ int |