I was doing a merge, and it failed to even compile the runtime libraries due to 
checking in bitmap.  bitmap goes to remove set bits from the bitmap (the second 
hunk in a two hunk set), and it fails to update the current pointer.  That 
memory is freed and then reallocated and a new index is put into it, and then 
we fail a consistency check later on due to the mismatch between head->index 
and head->current->indx, because current was not properly maintained.  This 
patch removes the old value of current when we remove what it points to from 
the bitmap.

Ok?

diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index 8f7f306..844c32e 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -278,7 +296,8 @@ bitmap_elt_clear_from (bitmap head, bitmap_element *elt)
   if (prev)
     {
       prev->next = NULL;
-      if (head->current->indx > prev->indx)
+      if (head->current->indx > prev->indx
+         || head->current == elt)
        {
          head->current = prev;
          head->indx = prev->indx;

Reply via email to