aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-01-29 19:29:08 +0000
committerDuncan Sands <baldrick@free.fr>2008-01-29 19:29:08 +0000
commit03408917ba127906ebf3f305b8115cde9a649dc5 (patch)
treed3eb3648ed17555027849f4ef7dbd1cd46f76d7a
parent75a2db813395e577d844d0996b4528010ee09e1d (diff)
downloadexternal_llvm-03408917ba127906ebf3f305b8115cde9a649dc5.zip
external_llvm-03408917ba127906ebf3f305b8115cde9a649dc5.tar.gz
external_llvm-03408917ba127906ebf3f305b8115cde9a649dc5.tar.bz2
When expanding an operand, it's not the result value
type that matters but the operand type. This fixes 2008-01-08-IllegalCMP.ll which crashed with the new legalize infrastructure because SETCC with result type i8 and operand type i64 was being custom expanded by the X86 backend. With this fix, the gcc build gets as far as the first libcall. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46525 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp
index ec8d6fa..2821372 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeTypesExpand.cpp
@@ -747,8 +747,8 @@ bool DAGTypeLegalizer::ExpandOperand(SDNode *N, unsigned OpNo) {
DEBUG(cerr << "Expand node operand: "; N->dump(&DAG); cerr << "\n");
SDOperand Res(0, 0);
- if (TLI.getOperationAction(N->getOpcode(), N->getValueType(0)) ==
- TargetLowering::Custom)
+ if (TLI.getOperationAction(N->getOpcode(), N->getOperand(OpNo).getValueType())
+ == TargetLowering::Custom)
Res = TLI.LowerOperation(SDOperand(N, 0), DAG);
if (Res.Val == 0) {