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

llvm-svn: 131467
This commit is contained in:
Stuart Hastings
2011-05-17 16:45:55 +00:00
parent 52375e6a01
commit 3cf5308890
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.