Fix an obscure issue in X86_64 parameter passing: if a tiny byval is

passed as the fifth parameter, insure it's passed correctly (in R9).
rdar://problem/6920088


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131467 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Stuart Hastings
2011-05-17 16:45:55 +00:00
parent 6e3b3e2122
commit 504421e327
3 changed files with 81 additions and 15 deletions

View File

@ -48,8 +48,12 @@ void CCState::HandleByVal(unsigned ValNo, MVT ValVT,
if (MinAlign > (int)Align)
Align = MinAlign;
TM.getTargetLowering()->HandleByVal(const_cast<CCState*>(this), Size);
unsigned Offset = AllocateStack(Size, Align);
addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo));
if (Size != 0) {
unsigned Offset = AllocateStack(Size, Align);
addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo));
} else {
addLoc(CCValAssign::getReg(ValNo, ValVT, getFirstByValReg(), LocVT, LocInfo));
}
}
/// MarkAllocated - Mark a register and all of its aliases as allocated.