From cee6093ca8ab49eb7b2d699f45c02d470f88fa13 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 27 Dec 2005 03:02:18 +0000 Subject: [PATCH] Fix a problem duraid pointed out to me compiling kc++ with -enable-x86-fastcc llvm-svn: 25024 --- lib/Target/X86/X86ISelLowering.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index b419f31d47a..a5b261c8374 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -591,6 +591,9 @@ X86TargetLowering::LowerFastCCArguments(Function &F, SelectionDAG &DAG) { X86::R8RegisterClass); ArgValue = DAG.getCopyFromReg(DAG.getRoot(), VReg, MVT::i8); DAG.setRoot(ArgValue.getValue(1)); + if (ObjectVT == MVT::i1) + // FIXME: Should insert a assertzext here. + ArgValue = DAG.getNode(ISD::TRUNCATE, MVT::i1, ArgValue); } ++NumIntRegs; break; @@ -780,6 +783,8 @@ X86TargetLowering::LowerFastCCCallTo(SDOperand Chain, const Type *RetTy, switch (getValueType(Args[i].second)) { default: assert(0 && "Unexpected ValueType for argument!"); case MVT::i1: + Args[i].first = DAG.getNode(ISD::ANY_EXTEND, MVT::i8, Args[i].first); + // Fall through. case MVT::i8: case MVT::i16: case MVT::i32: