On 10/06/2016 03:15 AM, Richard Biener wrote:

The following guards against (some) remove-current-bit cases.  It
would have ICEd for PR77855 instead of producing wrong code.

Bootstrap / regtest running on x86_64-unknown-linux-gnu.

Comments?

Thanks,
Richard.

2016-10-06  Richard Biener  <rguent...@suse.de>

        * bitmap.c (bitmap_elem_to_freelist): Set indx to -1.
        * bitmap.h (bmp_iter_set): When advancing to the next element
        check that we didn't remove the current one.
        (bmp_iter_and): Likewise.
        (bmp_iter_and_compl): Likewise.
Seems like a good idea to me -- I've been bitten by this during patch development in the past and it looks like you're hitting one of the more unpleasant cases.

Someone had posted a more robust approach to detecting unsafe modification of a bitmap during iteration many years ago, but nobody had the time/inclination to take it to proof-of-concept to see how it'd perform in the real world.


Jeff

Reply via email to