diff options
author | Stuart Hastings <stuart@apple.com> | 2011-05-17 16:45:55 +0000 |
---|---|---|
committer | Stuart Hastings <stuart@apple.com> | 2011-05-17 16:45:55 +0000 |
commit | 504421e327a5af90dbb42f33086b6db6f6738477 (patch) | |
tree | 9622c4c794aeb341afb907cd2ae0e2e789181155 /lib/CodeGen/CallingConvLower.cpp | |
parent | 6e3b3e21227d3498d7f5d9d314a49a9ee4cbb873 (diff) |
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
Diffstat (limited to 'lib/CodeGen/CallingConvLower.cpp')
-rw-r--r-- | lib/CodeGen/CallingConvLower.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/CodeGen/CallingConvLower.cpp b/lib/CodeGen/CallingConvLower.cpp index bfb6ba1023..7768e28979 100644 --- a/lib/CodeGen/CallingConvLower.cpp +++ b/lib/CodeGen/CallingConvLower.cpp @@ -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. |