diff options
| author | Duncan Sands <baldrick@free.fr> | 2008-07-10 15:26:17 +0000 |
|---|---|---|
| committer | Duncan Sands <baldrick@free.fr> | 2008-07-10 15:26:17 +0000 |
| commit | 4ac3984fc51f15035fe12d7211d9109a9fa2bf1a (patch) | |
| tree | 4ade4634dd393b5502a72db343f21b7e2860ed83 /llvm/lib/CodeGen | |
| parent | d4c09df689a9f2998dbe7a6f6213a50d7a288895 (diff) | |
| download | bcm5719-llvm-4ac3984fc51f15035fe12d7211d9109a9fa2bf1a.tar.gz bcm5719-llvm-4ac3984fc51f15035fe12d7211d9109a9fa2bf1a.zip | |
Make sure the alignment of the temporary created
in CreateStackStoreLoad is good enough for both
the source and destination types.
llvm-svn: 53404
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp index ed09c6b7124..7a0a52d97df 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp @@ -16,6 +16,7 @@ #include "LegalizeTypes.h" #include "llvm/CallingConv.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Target/TargetData.h" using namespace llvm; #ifndef NDEBUG @@ -547,8 +548,11 @@ SDOperand DAGTypeLegalizer::BitConvertToInteger(SDOperand Op) { SDOperand DAGTypeLegalizer::CreateStackStoreLoad(SDOperand Op, MVT DestVT) { - // Create the stack frame object. - SDOperand FIPtr = DAG.CreateStackTemporary(DestVT); + // Create the stack frame object. Make sure it is aligned for both + // the source and destination types. + unsigned SrcAlign = + TLI.getTargetData()->getPrefTypeAlignment(Op.getValueType().getTypeForMVT()); + SDOperand FIPtr = DAG.CreateStackTemporary(DestVT, SrcAlign); // Emit a store to the stack slot. SDOperand Store = DAG.getStore(DAG.getEntryNode(), Op, FIPtr, NULL, 0); |

