apparent integer promotions bug
Fri Mar 29 15:31:00 GMT 2002
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.
More information about the Gcc-bugs