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: long long bit-fields


Segher Boessenkool <segher at koffie dot nl> writes:

> Falk Hueffner wrote:
> > PR c/6346, middle-end/7018 and target/9620 deal with long long
> > bit-fields. [...]
>
> Correct (the integer promotions promote an unsigned integer
> bit-field to a signed integer, if it fits).

Okay. Then we can close middle-end/7018. Most other bit-field bugs
seem to be caused by casts to the bit-field's type getting discarded
erraneously, by the folder presumably. I'll try to have a look at that
some time in the future.

How about:

    struct { unsigned long long ull31a: 33; } x = { -1 };
    printf("%016llx\n", (x.ull31a << 48) >> 48);

We don't currently promote to signed long long if it fits. Should we?

-- 
	Falk


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