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

Re: [csmith-dev] unsafe math

Thanks guys!


On 08/19/2011 01:49 PM, Xuejun Yang wrote:
That’s the way to do it. Thanks, Tomyo.


[mailto:csmith-dev-bounces@flux.utah.edu] *On Behalf Of *Tomyo Maeshiro
*Sent:* Friday, August 19, 2011 1:30 PM
*To:* csmith-dev@flux.utah.edu
*Subject:* Re: [csmith-dev] unsafe math


I know that the option CGOptions::avoid_signed_overflow(false) stop using
the safe math functions. As far as I know it is true by default. I know
there is no option to turn it off. But it seems to be a simple modification.

Just add some code like this in the RandomProgramGenerator.cpp and use
--no-safe-math at command line.

if (strcmp (argv[i], "--no-safe-math") == 0){

I hope this helps.

Tomyo Maeshiro

On Fri, Aug 19, 2011 at 2:07 PM, John Regehr <regehr@cs.utah.edu
<mailto:regehr@cs.utah.edu>> wrote:

Does Csmith have an option to just stop using the safe math functions,
instead generating raw +, -, etc.?

I didn't see anything in the help output but thought I remembered that we
used to be able to do this.

This would be a very nice thing to have when just trying to crash compilers.

Xuejun-- if this doesn't exist, I imagine you don't have time to do it. Can
you tell me where to hack if I can make time over the weekend?