*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.