This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [C++0x] contiguous bitfields race implementation



*bit_offset = (TREE_INT_CST_LOW (DECL_FIELD_OFFSET (fld))
               * BITS_PER_UNIT
               + TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (fld)))
  - (TREE_INT_CST_LOW (DECL_FIELD_OFFSET (bitregion_start))
     * BITS_PER_UNIT
     + TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (bitregion_start)));

(Yes, I know we can factor out the BITS_PER_UNIT and only do one
multiplication, it's just easier to read this way.)

Is this what you had in mind?

Yes. For convenience I'd simply use double_ints for the intermediate calculations.

Ok, let's leave it like this for now. I have added a FIXME note, and we can optimize this after we get everything working.



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