Re: [PATCH 4/5] sparse, i386: Fix boolean bit size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 22, 2011 at 04:57:30PM +0300, Pekka Enberg wrote:
> The value of 'ctype->bit_size' is set to 1 for booleans which confuses the i386
> backend:
> 
>   ./compile allocate.c
>   compile: compile-i386.c:1406: emit_binop: Assertion `0' failed.
>   Aborted
> 
> Looking at the code, we assume that "bit_size / 8" gives a sane result on
> various places. This patch fixes the problem by bumping bit_size to 8 for
> booleans. This also makes sizeof(_Bool) return 1 which is consistent with what
> GCC 4.4.3, for example, does.

Seems reasonable; that would make it consistent with the behavior of
structs or arrays of bool, at least in GCC.  As far as I know, GCC
doesn't have any logic to attempt to compress a bool down to a single
bit of storage.

- Josh Triplett
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux