Message ID | Pine.LNX.4.64.1205100944210.11924@jbgna.fhfr.qr |
---|---|
State | New |
Headers | show |
> Like this?
Let's be a bit more factual. :-)
/* Return the combined truncated byte position for the byte offset OFFSET and
the bit position BITPOS.
These functions operate on byte and bit positions present in FIELD_DECLs
and assume that these expressions result in no (intermediate) overflow.
This assumption is necessary to fold the expressions as much as possible,
so as to avoid creating artificially variable-sized types in languages
supporting variable-sized types like Ada. */
On Thu, 10 May 2012, Eric Botcazou wrote: > > Like this? > > Let's be a bit more factual. :-) > > /* Return the combined truncated byte position for the byte offset OFFSET and > the bit position BITPOS. > > These functions operate on byte and bit positions present in FIELD_DECLs > and assume that these expressions result in no (intermediate) overflow. > This assumption is necessary to fold the expressions as much as possible, > so as to avoid creating artificially variable-sized types in languages > supporting variable-sized types like Ada. */ Works for me. Applied that way. Thanks, Richard.
Index: gcc/stor-layout.c =================================================================== --- gcc/stor-layout.c (revision 187362) +++ gcc/stor-layout.c (working copy) @@ -798,7 +798,11 @@ bit_from_pos (tree offset, tree bitpos) } /* Return the combined truncated byte position for the byte offset OFFSET and - the bit position BITPOS. */ + the bit position BITPOS. + These functions operate on byte and bit positions as present in FIELD_DECLs + and it assumes that expressions result in no (intermediate) overflow. + This assumption is necessary to optimize these values as much as possible, + especially to make Ada happy. */ tree byte_from_pos (tree offset, tree bitpos)