This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: apparent integer promotions bug
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- To: David Holland <dholland at eecs dot harvard dot edu>
- Cc: bug-gcc at gnu dot org
- Date: Fri, 29 Mar 2002 21:18:31 +0000
- Subject: Re: apparent integer promotions bug
- References: <200203292101.g2TL1vt27210@wally.eecs.harvard.edu>
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.