[patch, 4.1.2, 4.2.1, 4.3] Fix a bug in pointer dependency test

Daniel Berlin dberlin@dberlin.org
Thu Feb 22 18:29:00 GMT 2007


On 2/22/07, Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> wrote:
> Hello,
> > >--- 193,211 ----
> > >        if (!tag_b)
> > >        return false;
> > >      }
> > >!   bal1 = BITMAP_ALLOC (NULL);
> > >!   bitmap_set_bit (bal1, DECL_UID (tag_a));
> > >!   if (MTAG_P (tag_a) && MTAG_ALIASES (tag_a))
> > >!     bitmap_ior_into (bal1, MTAG_ALIASES (tag_a));
> > >!
> > >!   bal2 = BITMAP_ALLOC (NULL);
> > >!   bitmap_set_bit (bal2, DECL_UID (tag_b));
> > >!   if (MTAG_P (tag_b) && MTAG_ALIASES (tag_b))
> > >!     bitmap_ior_into (bal2, MTAG_ALIASES (tag_b));
> > >!   *aliased = bitmap_intersect_p (bal1, bal2);
> > >!
> > >!   BITMAP_FREE (bal1);
> > >!   BITMAP_FREE (bal2);
> > >    return true;
> > >  }
> > >
> > Why are you allocating two temporary bitmaps and copying bitmaps into
> > them just to do:
> >
> > *aliased = false;
> > if (tag_a == tag_b
> >   || (MTAG_P (tag_a) && MTAG_P (tag_b)
> >       && bitmap_intersect_p (MTAG_ALIASES (tag_a), MTAG_ALIASES (tag_b)))
> >  *aliased = true;
> > return true;
>
> This code is not equivalent, but
Sure. I was writing it without the original comments, so it wasn't
clear what it was trying to do exactly.
To make it equivalent, you'd need code there to check if bitmap_bit_p
(MTAG_ALIASES (tag_a), DECL_UID (tag_b)) || bitmap_bit_p (MTAG_ALIASES
(tag_b), DECL_UID (tag_a)).



More information about the Gcc-patches mailing list