1 /* Reduced from analyzer ICE seen with git-2.39.0's pack-bitmap.c
2 when bounds-checking the result of __builtin_ctzll. */
7 typedef uint64_t eword_t
;
15 void ewah_iterator_init(struct ewah_iterator
*it
, struct ewah_bitmap
*parent
);
16 int ewah_iterator_next(eword_t
*next
, struct ewah_iterator
*it
);
17 void bitmap_set(struct bitmap
*self
, size_t pos
);
19 int rebuild_bitmap(const uint32_t *reposition
,
20 struct ewah_bitmap
*source
,
24 struct ewah_iterator it
;
27 ewah_iterator_init(&it
, source
);
29 while (ewah_iterator_next(&word
, &it
)) {
30 uint32_t offset
, bit_pos
;
32 for (offset
= 0; offset
< (sizeof(eword_t
) * 8); ++offset
) {
33 if ((word
>> offset
) == 0)
36 offset
+= __builtin_ctzll(word
>> offset
);
38 bit_pos
= reposition
[pos
+ offset
];
40 bitmap_set(dest
, bit_pos
- 1);
45 pos
+= (sizeof(eword_t
) * 8);