aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-11-20 18:05:46 +0000
committerChris Lattner <sabre@nondot.org>2006-11-20 18:05:46 +0000
commit32ba1aa20468a1906ee69315bda47da6b1b2dc5e (patch)
treea86c7a6d250a3baa9012eece8f97864aab49b4ca /lib
parentf2d2a5a79ccc5d5fb8beafd315290b5bbb274232 (diff)
downloadexternal_llvm-32ba1aa20468a1906ee69315bda47da6b1b2dc5e.zip
external_llvm-32ba1aa20468a1906ee69315bda47da6b1b2dc5e.tar.gz
external_llvm-32ba1aa20468a1906ee69315bda47da6b1b2dc5e.tar.bz2
Fix PR1011 and CodeGen/Generic/2006-11-20-DAGCombineCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31878 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index b74fbae..4499069 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -2180,10 +2180,10 @@ SDOperand DAGCombiner::visitTRUNCATE(SDNode *N) {
// fold (truncate (ext x)) -> (ext x) or (truncate x) or x
if (N0.getOpcode() == ISD::ZERO_EXTEND || N0.getOpcode() == ISD::SIGN_EXTEND||
N0.getOpcode() == ISD::ANY_EXTEND) {
- if (N0.getValueType() < VT)
+ if (N0.getOperand(0).getValueType() < VT)
// if the source is smaller than the dest, we still need an extend
return DAG.getNode(N0.getOpcode(), VT, N0.getOperand(0));
- else if (N0.getValueType() > VT)
+ else if (N0.getOperand(0).getValueType() > VT)
// if the source is larger than the dest, than we just need the truncate
return DAG.getNode(ISD::TRUNCATE, VT, N0.getOperand(0));
else