[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [csmith-dev] unsigned compares not supported
Thanks, This will be really helpful
On Thu, Jul 21, 2011 at 12:28 AM, Arthur O'Dwyer <email@example.com>
On Wed, Jul 20, 2011 at 7:33 PM, John Regehr <firstname.lastname@example.org> wrote:
> Hi Tomyo,
> On 7/20/2011 6:39 PM, Tomyo Maeshiro wrote:
>> I need to generate programs for a compiler that doesn't support unsigned
>> comparisons. Is there a way to deal with that in csmith?
> Xuejun might be able to add this, but on the other hand he is very busyAFAIK, it should be just a matter of printing "((signed)e1 <
> writing his thesis these days.
(signed)e2)" everywhere you'd normally print "(e1 < e2)". That place
should be easier to find than it is, though. :P I think the printing
code for this case is located in FunctionInvocationBinary::Output() or
one of its callees. Alternatively, it might be possible to modify
random _expression_ generator so that unsigned expressions are not
considered valid operands to comparison operators. I think that code
is located somewhere inside FunctionInvocation::make_random_binary(),
but lots of luck with that.
(I've been meaning to hack on Csmith a lot more than I actually have.
I forked it on Github a long time ago, but after that first short
burst, every time I start looking at it I get bogged down in
complexity almost immediately.)
For what it's worth, I'm wondering the same thing.
> What kind of C compiler doesn't support unsigned comparisons?
Does this compiler perhaps not support unsigned types at all? If so,
could you simply "typedef uint32_t int32_t;" etc. in the boilerplate?
Or hack Csmith to completely avoid generating unsigned types at all?
---maybe that's easier than hacking out unsigned comparisons