On 4/3/19 6:31 PM, Martin Jambor wrote: > Hello Shubham, > > On Fri, Mar 29 2019, Shubham Narlawar wrote: >> Hi, here is my proposal for the above idea. Please review and suggest >> necessary changes. >> >> https://docs.google.com/document/d/11MNhuuD7dbwAfSW6ZgFrAys9My1Lw1PuMVcAqeNGr7A/edit?usp=sharing > > I have had a quick look and the proposal seems very nice. > > How did you select the attributes you want to implement in csmith? It > is for example a little strange that you decided to include "pure" but > not "const." If you handle visibility, you might as well consider > throwing in externally_visible too, I guess. As a stretch goal, the > alias function attribute might be useful to exercise nasty paths in GCC > IPA optimizations. > > I assume Andi Kleen has seen this proposal and if he is fine with it, so > am I. > > Thanks, > > Martin >
Hi. Just for the record, Martin Jambor asked me to co-mentor during time period when Andi will be on vacation (if I'm correct). I have couple of questions/ideas about the proposal: 1) I would not spend much time with nested functions, it's quite legacy C extension 2) for functions, I would basically include add potential attribute: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes see: gcc/c-family/c-attribs.c:242 const struct attribute_spec c_common_attribute_table[] = ... 3) similarly for variables: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#Common-Variable-Attributes 4) and similarly for types https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html#Common-Type-Attributes 5) One big question about csmith I have. It's quite easy to come up with a test-case which causes an ICE. But it's more difficult to come up with a test-case that is miscompiled by a compiler. It's mainly due to an invalid behavior in the generated test-case. One can theoretically catch that with sanitizers (ASAN, UBSAN, ...). But still, it's not easy. Are you considering catching wrong-code issue? Thanks, Martin