aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKazu Hirata <kazu@codesourcery.com>2005-06-07 20:45:08 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2005-06-07 20:45:08 +0000
commit108267cd5609ef326744e1593f878a36e3c09675 (patch)
treefe58c0e358d54ef7912f1d998493dc0e40326547 /gcc
parente699ee2475bbeb933abcbecfc25ffe1304645eb4 (diff)
downloadgcc-108267cd5609ef326744e1593f878a36e3c09675.zip
gcc-108267cd5609ef326744e1593f878a36e3c09675.tar.gz
gcc-108267cd5609ef326744e1593f878a36e3c09675.tar.bz2
sbitmap.h (sbitmap_iter_init): Consistently treat bit_num as the current bit index with no modulo.
* sbitmap.h (sbitmap_iter_init): Consistently treat bit_num as the current bit index with no modulo. From-SVN: r100720
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/sbitmap.h7
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e200023..04974e5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-07 Kazu Hirata <kazu@codesourcery.com>
+
+ * sbitmap.h (sbitmap_iter_init): Consistently treat bit_num as
+ the current bit index with no modulo.
+
2005-06-07 Sebastian Pop <pop@cri.ensmp.fr>
PR 18403 and meta PR 21861.
diff --git a/gcc/sbitmap.h b/gcc/sbitmap.h
index fe23cbf..7f40d8a 100644
--- a/gcc/sbitmap.h
+++ b/gcc/sbitmap.h
@@ -66,7 +66,7 @@ typedef struct {
/* The current word index. */
unsigned int word_num;
- /* The current bit index. */
+ /* The current bit index (not modulo SBITMAP_ELT_BITS). */
unsigned int bit_num;
/* The words currently visited. */
@@ -80,14 +80,15 @@ static inline void
sbitmap_iter_init (sbitmap_iterator *i, sbitmap bmp, unsigned int min)
{
i->word_num = min / (unsigned int) SBITMAP_ELT_BITS;
- i->bit_num = min % (unsigned int) SBITMAP_ELT_BITS;
+ i->bit_num = min;
i->size = bmp->size;
i->ptr = bmp->elms;
if (i->word_num >= i->size)
i->word = 0;
else
- i->word = i->ptr[i->word_num] >> i->bit_num;
+ i->word = (i->ptr[i->word_num]
+ >> (i->bit_num % (unsigned int) SBITMAP_ELT_BITS));
}
/* Return true if we have more bits to visit, in which case *N is set