mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-23 05:29:23 +00:00
Offset for load of 32-bit arg in 64-bit world was incorrect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32019 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
cdc70ce82c
commit
619965d32e
@ -1123,6 +1123,7 @@ static SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG,
|
||||
bool needsLoad = false;
|
||||
MVT::ValueType ObjectVT = Op.getValue(ArgNo).getValueType();
|
||||
unsigned ObjSize = MVT::getSizeInBits(ObjectVT)/8;
|
||||
unsigned ArgSize = ObjSize;
|
||||
|
||||
unsigned CurArgOffset = ArgOffset;
|
||||
switch (ObjectVT) {
|
||||
@ -1138,6 +1139,7 @@ static SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG,
|
||||
++GPR_idx;
|
||||
} else {
|
||||
needsLoad = true;
|
||||
ArgSize = PtrByteSize;
|
||||
}
|
||||
break;
|
||||
case MVT::i64: // PPC64
|
||||
@ -1203,7 +1205,8 @@ static SDOperand LowerFORMAL_ARGUMENTS(SDOperand Op, SelectionDAG &DAG,
|
||||
// If the argument is actually used, emit a load from the right stack
|
||||
// slot.
|
||||
if (!Op.Val->hasNUsesOfValue(0, ArgNo)) {
|
||||
int FI = MFI->CreateFixedObject(ObjSize, CurArgOffset);
|
||||
int FI = MFI->CreateFixedObject(ObjSize,
|
||||
CurArgOffset + (ArgSize - ObjSize));
|
||||
SDOperand FIN = DAG.getFrameIndex(FI, PtrVT);
|
||||
ArgVal = DAG.getLoad(ObjectVT, Root, FIN, NULL, 0);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user