From: Duraid Madina Date: Fri, 13 Jan 2006 10:28:25 +0000 (+0000) Subject: don't be a doofus - this fixes storing bools X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=544cbbd479e5fb5ca977f86c089565df12ea7923;p=oota-llvm.git don't be a doofus - this fixes storing bools git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25274 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/IA64/IA64ISelDAGToDAG.cpp b/lib/Target/IA64/IA64ISelDAGToDAG.cpp index 41ae9935573..f8827ea06b8 100644 --- a/lib/Target/IA64/IA64ISelDAGToDAG.cpp +++ b/lib/Target/IA64/IA64ISelDAGToDAG.cpp @@ -571,9 +571,12 @@ SDOperand IA64DAGToDAGISel::Select(SDOperand Op) { default: assert(0 && "unknown type in store"); case MVT::i1: { // this is a bool Opc = IA64::ST1; // we store either 0 or 1 as a byte + // first load zero! + SDOperand Initial = CurDAG->getCopyFromReg(Chain, IA64::r0, MVT::i64); + Chain = Initial.getValue(1); + // then load 1 iff the predicate to store is 1 SDOperand Tmp = - CurDAG->getTargetNode(IA64::PADDS, MVT::i64, - CurDAG->getRegister(IA64::r0, MVT::i64), + CurDAG->getTargetNode(IA64::PADDS, MVT::i64, Initial, CurDAG->getConstant(1, MVT::i64), Select(N->getOperand(1))); return CurDAG->SelectNodeTo(N, Opc, MVT::Other, Address, Tmp, Chain);