This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: More on type sizes
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Subject: Re: More on type sizes
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Wed, 29 Dec 1999 23:18:46 +0000 (GMT)
- CC: gcc at gcc dot gnu dot org
> Now that I think about it, why do we need TYPE_SIZE *at all*? The
> only place we currently allow a size not to be a multiple of
> BITS_PER_UNIT is the DECL_SIZE of a bitfield. At some point, it would
> indeed be nice to support such things as bit-packed arrays, where we
> actually *do* have a type whose size is, say, 1 bit, but in that case
> what would TYPE_SIZE_UNIT mean?
When a size is caluclated in bytes, we want to use TYPE_SIZE so that we
get the expected overlow effects.
When a size is calculated in bits, we don't want them.
Note that not only the size, but also the offset of a bitfield has to
be expressed in single bits - unless we want to use a representation
as sum of a multiple of BITS_PER_UNIT plus a single-bit count that
is smaller than BITS_PER_UNIT.
The original problem that propted the introduction of bitsizetype
was actually not a 32 bit compilation, but a 32->16 bit cross compilation.
The way this 'worked' was so that a structure could not be as large as
4 KB.