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

Re: [csmith-dev] Checksum, different options



Hello,

On Mon, Sep 12, 2011 at 2:41 PM, Paulo J. Matos <Paulo.Matos@csr.com> wrote:
Can someone please confirm that I should expect the same checksum even when I compile the same file, with the same compiler but different optimisation options?

$ gcc -Os -o test test.c
checksum = 9E81
$ gcc -O0 -o test test.c
checksum = 8A6A

Is this expected or is a bug (gcc or csmith)?

Csmith is supposed to produce well defined programs that run the same on a given platform.
The same compiler with different optimization producing programs that run differently is a good sign that you have found either a bug in the compiler or a bug in Csmith (that may not have produced a well-defined program after all).

If you post the program, I may be able to tell you quickly whether it's defined, unless it is for this 16-bit char architecture of yours, in which case I would only be able to tell you quickly whether it would be defined if it was for a more usual architecture. I really should take the time to replace all these "8"s in Frama-C's source code by something more generic.

Pascal