Make sure that bool,byte and short arguments are the right type when loaded
authorChris Lattner <sabre@nondot.org>
Sun, 15 Jan 2006 22:22:01 +0000 (22:22 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 15 Jan 2006 22:22:01 +0000 (22:22 +0000)
from memory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25346 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/SparcISelDAGToDAG.cpp
lib/Target/SparcV8/SparcV8ISelDAGToDAG.cpp

index 56dc26a2fa4a2a4895076960e58cf7c0117a4e81..08c66367141ccc4959486f1c02a150850d85e237 100644 (file)
@@ -243,6 +243,7 @@ SparcV8TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) {
 
           Load = DAG.getExtLoad(LoadOp, MVT::i32, Root, FIPtr,
                                 DAG.getSrcValue(0), ObjectVT);
+          Load = DAG.getNode(ISD::TRUNCATE, ObjectVT, Load);
         }
         ArgValues.push_back(Load);
       }
index 56dc26a2fa4a2a4895076960e58cf7c0117a4e81..08c66367141ccc4959486f1c02a150850d85e237 100644 (file)
@@ -243,6 +243,7 @@ SparcV8TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) {
 
           Load = DAG.getExtLoad(LoadOp, MVT::i32, Root, FIPtr,
                                 DAG.getSrcValue(0), ObjectVT);
+          Load = DAG.getNode(ISD::TRUNCATE, ObjectVT, Load);
         }
         ArgValues.push_back(Load);
       }