Hi, bitmap.c:bitmap_last_set_bit() is not used by any code in the current GCC trunk, but I'm using it and I noticed it returns an incorrect result. This patch rewrites most of the function to return the correct result.
Not sure how to test this other than to say that my code, that uses this function, works with the patch and breaks without it. I've also unleashed bitmap_last_set_bit (and bitmap_first_set_bit) on a large number of randomly generated bitmaps and rather expensive verification code that doesn't accept the results of the pre-patch bitmap_last_set_bit and is happy with my new implementation. OK for trunk? Ciao! Steven * bitmap.c (bitmap_last_set_bit): Rewrite to return the correct bit.
bitmap_last_bit_set.diff
Description: Binary data