[llvm-commits] CAST Patch Update (Review Only)

Reid Spencer rspencer at reidspencer.com
Sat Nov 11 23:19:20 PST 2006


Chris & Others,

NOTE: Please Don't commit this!

Attached is the latest CAST patch. This passes all llvm/test and
llvm-test test cases with the exception of MultiSource/Applications/hbd.
I'm hoping that fresh eyes on this patch can help discover the problem
because it is a mystery I have not solved in two weeks.

The problem is not a mis-optimization. The unoptimized bytecode fails
the test as does every permutation of the gccas optimization passes.
Except for the fact that the nightly test passes this test, I'm
unconvinced that this is directly related to the CAST patch. Its
possible that the CAST patch exposes a bug somewhere else.

Below are some details to characterize the problem. 

When hbd is compiled in debug mode (-g) it passes. If not it fails. The
gcc compiled native version shows no valgrind errors. The llc compiled
version shows 31 valgrind errors (but only in the optimized version). In
that case valgrind reports:

ERROR SUMMARY: 31 errors from 1 contexts (suppressed: 18 from 1)
31 errors in context 1 of 1:
Use of uninitialised value of size 8
  by 0x8048A40: (within /proj/llvm/llvm-test-1/MultiSource/Applications/hbd/Output/hbd.llc)

This obviously isn't much help. Since these are uninitialized data
errors, this could account for the difference in behavior. 

The output from the hbd program is C++ code. It decompiles a Java class
into the C++ equivalent. The diff between the native and llc output is
several examples of this:

35c35
<       --var4; /*63*/
---
>       var4 -= -1;     /*63*/

This difference output is one reason why I *do* think the problem could
be related to the CAST patch or at least some of the signless types
work.  It appears to be doing a sign extension instead of a zero
extension on a boolean to arrive at the decrement value.

Any help you can provide with reviewing this patch or formulating a
strategy for finding the bug would be greatly appreciated.

Thanks in advance,

Reid.

FYI: bugpoint has been hopeless at reducing this to anything meaningful.




-------------- next part --------------
A non-text attachment was scrubbed...
Name: CAST.patch
Type: text/x-patch
Size: 414836 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20061111/90f5d240/attachment.bin>


More information about the llvm-commits mailing list