I learnt from "scripts/compiler_test.pl <http://compiler_test.pl>" that, a wrong code bug is determined by comparing the checksum output value generated across different optimization levels. So if a compiler wrong-code bug exists across all optimization, how do i find it?
Bugs where a compiler emits the same wrong code at all optimization levels are easy to find: you just need to include two independently developed compilers in the set of compilers to test. We often test Clang against GCC. Since most compiler bugs are in the optimizers, it is quite uncommon to find these bugs. But it happens.
2. Suppose if set "bitfields_creation_prob=100" (100% probability?) in my configuration file and use it to generate a testcase, should the generated testcase contain atleast one bitfield structure in it? For me, setting "bitfields_creation_prob=100" didn't create any testcase with bitfield in it. i'm bit unclear about
It does not mean that your program will always contain bitfields. Yang can explain the probability file more, but please do not consider these to be a well-supported feature of Csmith.
If you want programs that always contain bitfields, you should generate a lot of programs and filter out the ones you do not want.
3. What is the the ideal timeout value for csmith to generate a testcase. Can i consider $CSMITH_TIMEOUT = 90; itself? or it may take more than that also?
In my experience it can take longer than any timeout :). 90 seconds is probably fine.
4. I'm not able to understand some of the statistics generated at the end of each test case. i.e. XXX max struct depth: 1 breakdown: depth: 0, occurrence: 412 depth: 1, occurrence: 37 XXX max expression depth: 2 breakdown: depth: 0, occurrence: 417 depth: 1, occurrence: 35 depth: 2, occurrence: 2
Xuejun will have to explain this. John