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

Re: [csmith-dev] CSmith bitfields wreak havoc



Hi Paulo,

I compiled the program on my 32-bit machine, and it seems fine.
 
When you say " f2 has bit-field width 29 but f2 size is 16", do you actually
mean the integer size is 16? Were you doing cross-testing? If so you need to
modify the file "platform.info" in your working directory.

thanks,
-Xuejun  

> -----Original Message-----
> From: Paulo J. Matos [mailto:Paulo.Matos@csr.com]
> Sent: Wednesday, August 24, 2011 2:23 AM
> To: csmith-dev@flux.utah.edu; Xuejun Yang
> Subject: CSmith bitfields wreak havoc
> 
> Hi,
> 
> After Xuejun confirmed that the 0-bitfield issue was fixed I updated my
> git version, recompiled and now get problems with sizes of bitfields
> being larger than their type.
> /*
>   * This is a RANDOMLY GENERATED PROGRAM.
>   *
>   * Generator: csmith 2.1.0
>   * Git version: b911750
>   * Options:   --no-checksum --no-math64 --no-longlong --no-argc
>   * Seed:      1994221572
>   */
> 
> 
> #define NO_LONGLONG
> 
> #include "csmith.h"
> 
> volatile uint32_t csmith_sink_ = 0;
> 
> static long __undefined;
> 
> /* --- Struct/Union Declarations --- */
> struct S0 {
>     signed f0 : 16;
>     uint32_t  f1;
>     signed f2 : 29;
> };
> 
> 
> ....
> 
> 
> f2 has bitfield width 29 but f2 size is 16. GCC doesn't compile
> complaining that:
> error: width of 'f2' exceeds its type.
> 
> 
> Cheers,
> 
> --
> PMatos
> 
> 
> Member of the CSR plc group of companies. CSR plc registered in England
and
> Wales, registered number 4187346, registered office Churchill House,
> Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
> More information can be found at www.csr.com. Follow CSR on Twitter at
> http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog