This is the mail archive of the gcc-patches@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: [testcase] Failure with new bitfield patch (was Re: [RFA] Fix type of bitfields)


Jakub Jelinek wrote:-

> Unfortunately, this patch breaks ABI seriously (e.g. tons of hardware
> drivers will stop working).

Ugh.  I think I should revert the patch.
 
> ATM struct A will be 3 bytes wide while it used to be 2 bytes wide.
> The problem is that with your patch at place_field time field b
> has unsigned char type (while it used to have unsigned short type),

It shouldn't have unsigned char type.  It should have type "unsigned
integer of 5 bits" for struct A.  If it doesn't, then I'm confused.
My understanding of the integer types of GCC is that they are fully
specified by their signedness and their width.

> Now, cannot the field types be changed in finish_struct after they all have
> been placed instead of changing them early?

Possibly; I think doing it earlier is what broke the debug stuff for
enums, though I'm not sure as I've not had time to investigate.

Does your question mean that declaring a bitfield of type "unsigned
char:3" and another of "unsigned short: 3" should give them different
types?  If so, then we need to store that information somewhere; possibly
in the "type" field of the common part of the tree_type?

Neil.


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