> This avoids setting the TREE_OVERFLOW bit on DECL_FIELD_OFFSET for
> the shifted bounds field.
>
> If DECL_FIELD_OFFSET of array-field is always a constant we could
> as well use
>
>   DECL_FIELD_OFFSET (bounds_field)
>     = size_int (-int_byte_position (array_field));
>
> also I notice that DECL_OFFSET_ALIGN is now bogus for bounds_field.

Yes, the offsets in the template record are fixed.

> DECL_FIELD_OFFSET no longer has the desired zero bits.  Shouldn't we
> instead set DECL_FIELD_OFFSET to -DECL_OFFSET_ALIGN and adjust
> DECL_FIELD_BIT_OFFSET accordingly?
>
> Well, with the above questions and suggestions I'd rather leave it
> to you deciding whether you like the below hack or want to rework
> the function a bit.

I guess that we have 3 solutions:
 - keep the negative offset hack and patch up,
 - make DECL_FIELD_OFFSET use ssizetype instead of sizetype,
 - remove the negative offset hack and devise a replacement mechanism.

We previously discussed 2 internally and agreed that it would be kind of an 
earthquake (feel free to differ though :-)  So it's probably about time to 
bite the bullet and tackle 3 seriously...

-- 
Eric Botcazou

Reply via email to