This is the mail archive of the gcc-bugs@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: apparent integer promotions bug


David Holland wrote:-

> It appears that left-shifting an unsigned value is generating a signed
> value, but only when a bitfield is involved.

There a bunch of issues with bitfields, which are known, but they are
surprisingly hard to fix with the current organization of the front
ends.  I tried and failed for 3.1; thwarted by the timing and method of
generation of debug information.

The main issue is that GCC internally records the type of the bitfield not
as a new type of its true width, but as a type such as "unsigned int".
This then means that various code has to do special checks for whether
a bitfield is involved.  As you can imagine, this is quite error prone
and not a good long-term plan.

I may try for 3.2, but it requires quite a bit of reoriganization.

Neil.


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