This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: bitmap fix for current
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Mike Stump <mikestump at comcast dot net>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 14 Nov 2014 11:26:11 +0100
- Subject: Re: bitmap fix for current
- Authentication-results: sourceware.org; auth=none
- References: <61212D56-5FE8-4496-BC6E-19920F55236E at comcast dot net> <54655677 dot 8040509 at redhat dot com>
On Fri, Nov 14, 2014 at 2:10 AM, Jeff Law <law@redhat.com> wrote:
> On 11/13/14 12:37, Mike Stump wrote:
>>
>> 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.
>
> Was the calling code iterating through the bit with a form like
>
> EXECUTE_IF_SET_IN_BITMAP (something, 0, i, bi)
> {
> bitmap_clear_bit (something, i)
> [ ... whatever code we want to process i, ... ]
> }
>
> If so, that's the real issue and we'd really like to identify & fix any code
> that has that kind of structure.
>
> See:
>
> https://gcc.gnu.org/ml/gcc/2009-06/msg00482.html
Indeed. I can't see how this can have triggered:
prev = elt->prev;
if (prev)
{
prev->next = NULL;
if (head->current->indx > prev->indx)
{
head->current = prev;
head->indx = prev->indx;
so if there was elt->prev then if current == elt current->indx should
better be > prev->indx.
Sth else must be wrong (and I doubt it's the above bogus use of
bitmaps).
Richard.
> jeff