This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Aliasing problems in GNU Chill?


  In message <19990901144104.A6143@x8b4e53cd.dhcp.okstate.edu>you write:
  > I was reading through andps.c in libchill recently and came across this.
  > 
  >   else if (bitlength <= SET_SHORT_SIZE)
  >     {
  >       *((SET_SHORT *)out) = *((SET_SHORT *)left) &
  >                             *((SET_SHORT *)right);
  >       MASK_UNUSED_SHORT_BITS((SET_SHORT *)out, bitlength);
  >     }
  > 
  > It appears to me that this suffers from the same aliasing problems that
  > we've  been hearing about recently. No?
Yes.

I see libchill's bitset code is badly littered with this stuff.  How
unpleasant.

Though it is unlikely to make a difference in this code as-is since there
are no real instruction reordering opportunities that would cause the the
scheduler to move instructions in an unsafe manner.

Still this code should be fixed.    Do you want to work cleaning up this code?

jeff



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]