Consider: int test(unsigned short X, short Y) { return X+Y; } $ llvm-gcc t.c -c -emit-llvm -o - -O3 | llc -march=c signed int test(signed short ltmp_0_1, signed short ltmp_1_1) { return ((((signed int )(signed short )ltmp_1_1)) + (((unsigned int )(unsigned short )ltmp_0_1))); } The first argument should be unsigned. This is a serious bug, because it means that bugpoint will get confused more often than it currently does. -Chris
Fixed. No llvm-commits email so no patch :( Reid.
Here's the patch that fixes this: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070101/042173.html