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

Re: [csmith-dev] Using safe math headers in csmith

Hi Karine, I believe there was a compiler that we wanted to target that had a weak function inliner, but I'm not 100% that's the right explanation.


On 2/25/20 3:17 AM, Even Mendoza, Karine wrote:
Hi John,
Thank you much for the help and instructions. It does work for me now.

Another question I have is regarding the reason for providing both macro-based and function-based headers.  Was it related to performance, undefined behaviour, or something else?



-----Original Message-----
From: csmith-dev-bounces@flux.utah.edu [mailto:csmith-dev-bounces@flux.utah.edu] On Behalf Of John Regehr
Sent: 24 February 2020 18:01
To: csmith-dev@flux.utah.edu
Subject: Re: [csmith-dev] Using safe math headers in csmith

This email originates from outside Imperial. Do not click on links and attachments unless you recognise the sender.
If you trust the sender, add them to your safe senders list https://spam.ic.ac.uk/SpamConsole/Senders.aspx to disable email stamping for this address.
Hi Karine, ok, I looked into this. Both of these alternative header files appear to work just fine. If you want to use the NOTMP versions, you need to pass Csmith the additional --math-notmp flag.

I ran this shell script a few times and both versions always produced the same checksum:

./src/csmith > foo.c
clang -O0 -w foo.c -I../runtime -o foo1
clang -O0 foo.c -I../runtime -DUSE_MATH_MACROS -w -o foo2 ulimit -t 2

Let us know if anything doesn't work as advertised.


On 2/24/20 8:20 AM, John Regehr wrote:
Hi Karine,

Well, I just tried to compile a program using -DUSE_MATH_MACROS_NOTMP
and it did not compile, so something must have gone wrong here. I
assume the same thing happened when you tried this?

I'll try to look into it soon.


On 2/24/20 2:28 AM, Even Mendoza, Karine wrote:

I would like to know if the version of csmith using the header
safe_math_macros.h or safe_math_macros_notmp.c is working.

Can I use these headers instead of safe_math.h and expect the same
output for the generated programs?

Thanks much,