This is the mail archive of the gcc@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: bit_size_type - a data type?


On Mon, May 12, 2008 at 1:26 PM, Richard Kenner
<kenner@vlsi1.ultra.nyu.edu> wrote:
> > bitsizetype is a type that can hold any values of sizetype *
>  > BITS_PER_UNIT so we can safely do bit-size calculations without overflow.
>  > This type shouldn't end up used in code though.
>
>  Unfortunately, it does, though not in C.  Ada's 'Size attribute returns
>  the size in bits, so the proper type for that computations is bitsizetype,
>  though many computations end up being constant-folded.

I gues you'll get funny effects then, as for Nbit sizetype there's
usually no valid
mode for (N+8)bit bitsizetype.  In fact, I believe bitsizetype simply
"inherits" the
mode from sizetype.

Richard.


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