Dear Csmith developers,
I'm running Csmith on a x86-64 platform and running the output with
gcc (64 bits), gcc -m32 (32 bits), and CompCert (32 bits).
For a while I was very worried that CompCert-generated code reported
different checksums than gcc. Then I understood that different
checksum algorithms are used with CompCert and with gcc.
I'd like to offer the following suggestions:
1- In --ccomp mode, always generate
#define NO_LONGLONG
before #include "csmith.h", so that even if the output is compiled
with gcc, a 32-bit checksum will be computed.
Same goes for SPLAT mode? (whatever that is).
2- In -no-longlong mode, do not generate
#ifndef __x86_64__
#define NO_LONGLONG
#endif
but do generate
#define NO_LONGLONG
(Why single out x86_64???)
Another, more radical suggestions would be to have two functions
crc32_4bytes (uint32_t val)
crc32_8bytes (uint64_t val) (only #ifndef NO_LONGLONG)
and call crc32_4bytes for all variables of type 32 bit or smaller
and call crc32_8bytes only for variables of type 64 bit int.