summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-30 16:56:19 +0000
committerChris Lattner <sabre@nondot.org>2005-08-30 16:56:19 +0000
commit9a4ad487f03d4be71ac7ee13764b6a6852226534 (patch)
treebbfaf3d9183fa46cc146b738b08509c3d3ed7c4e /llvm/lib/CodeGen
parenta3da8c4819cbdf8f0edabfc56749f600181baf4a (diff)
downloadbcm5719-llvm-9a4ad487f03d4be71ac7ee13764b6a6852226534.tar.gz
bcm5719-llvm-9a4ad487f03d4be71ac7ee13764b6a6852226534.zip
Fix a miscompile of PtrDist/bc. Sign extending bools is not the right thing,
at least tends to expose problems elsewhere. llvm-svn: 23149
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 9480ed6f096..db3b33abc51 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -2011,7 +2011,10 @@ SDOperand SelectionDAGLegalize::PromoteOp(SDOperand Op) {
Result = DAG.getNode(ISD::UNDEF, NVT);
break;
case ISD::Constant:
- Result = DAG.getNode(ISD::SIGN_EXTEND, NVT, Op);
+ if (VT != MVT::i1)
+ Result = DAG.getNode(ISD::SIGN_EXTEND, NVT, Op);
+ else
+ Result = DAG.getNode(ISD::ZERO_EXTEND, NVT, Op);
assert(isa<ConstantSDNode>(Result) && "Didn't constant fold zext?");
break;
case ISD::ConstantFP:
OpenPOWER on IntegriCloud