[LLVMdev] updated code size comparison

John Regehr regehr at cs.utah.edu
Wed Jan 20 12:49:22 PST 2010


> Indeed, but can't an analysis find at least one value for each variable
> where the behavior is not undefined?
> Such a value must exist, or the entire function is useless if it always
> has undefined behavior.

Good point :).

> Sure, testing on 1 such value (or a random) value won't prove that the
> result is correct, but may help finding trivial
> miscompilations like the neon_helper case.

Are you absolutely sure it's a miscompilation?  I have already shot myself 
in the foot a couple times on the GCC mailing list or bugzilla by pointing 
out a bug that turned out to be code with subtle undefined behavior...

> Alternatively a testcase could be manually constructed for the top 10
> functions in the size comparison charts,
> and see whether they are miscompiled. Repeat until top 10 has no
> miscompilations.

Tell you what: if I get enough test cases like this, I'll write the test 
harness supporting it.  I don't have time to do this kind of code 
inspection myself.

There has been talk (I don't remember where) about a Clang option for 
detecting undefined behavior.  Is there any progress on this?  This could 
be used to enable automated random testing.

John



More information about the llvm-dev mailing list