aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-04-27 17:12:52 +0000
committerChris Lattner <sabre@nondot.org>2007-04-27 17:12:52 +0000
commiteb7f34f2cb1584f155b9cefdb246b300fb2fc9c4 (patch)
tree0348a037dbbdfd429343462e097507366af3a6b2
parent85f777946e773c1670488cd7f716d02de2b9203d (diff)
Fix incorrect legalization of EHSELECTOR. This fixes
CodeGen/Generic/2007-04-14-EHSelectorCrash.ll and PR1326 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36510 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 1835ce2f9c..99394c73a3 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -692,12 +692,14 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
Result = TLI.LowerOperation(Op, DAG);
if (Result.Val) break;
// Fall Thru
- case TargetLowering::Legal:
- Result = DAG.getNode(ISD::MERGE_VALUES, VT, DAG.getConstant(0, VT), Tmp1).
- getValue(Op.ResNo);
+ case TargetLowering::Legal: {
+ SDOperand Ops[] = { DAG.getConstant(0, VT), Tmp1 };
+ Result = DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(VT, MVT::Other),
+ Ops, 2).getValue(Op.ResNo);
break;
}
}
+ }
break;
case ISD::EHSELECTION: {
Tmp1 = LegalizeOp(Node->getOperand(0));
@@ -714,12 +716,14 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
Result = TLI.LowerOperation(Op, DAG);
if (Result.Val) break;
// Fall Thru
- case TargetLowering::Legal:
- Result = DAG.getNode(ISD::MERGE_VALUES, VT, DAG.getConstant(0, VT), Tmp2).
- getValue(Op.ResNo);
+ case TargetLowering::Legal: {
+ SDOperand Ops[] = { DAG.getConstant(0, VT), Tmp2 };
+ Result = DAG.getNode(ISD::MERGE_VALUES, DAG.getVTList(VT, MVT::Other),
+ Ops, 2).getValue(Op.ResNo);
break;
}
}
+ }
break;
case ISD::AssertSext:
case ISD::AssertZext: