While compiling libmng (via llvm-gcc4 -O2) I've got an assertion: cc1: /home/asl/proj/llvm/src/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1116: llvm::SDOperand llvm::SelectionDAG::getNode(unsigned int, llvm::MVT::ValueType, llvm::SDOperand): Assertion `Operand.getValueType() > VT && "Invalid truncate node, src < dst!"' failed. libmng_pixels.i:137: internal compiler error: Aborted Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://llvm.org/bugs> for instructions. Please find: 1. Original source 2. Reduced sources (via delta). Everything was ok without any optimizations (but no ok with just -O), so the problem itself can be not in backend, but in some optimization passes.
Created attachment 467 [details] Reduced sources
Created attachment 468 [details] Original sources
verified
Fixed, patch here: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20061120/040136.html Testcase here: CodeGen/Generic/2006-11-20-DAGCombineCrash.ll -Chris