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 | 3cf53088900bc6940240fb06014718f654c1cae2 (patch) | |
tree | c83090a07444b0309b495e9ddddb831174e08114 /llvm/lib/CodeGen/CallingConvLower.cpp | |
parent | 52375e6a01a0dd8a8c1fbc197316ec5868edc14c (diff) | |
download | bcm5719-llvm-3cf53088900bc6940240fb06014718f654c1cae2.tar.gz bcm5719-llvm-3cf53088900bc6940240fb06014718f654c1cae2.zip |
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
Diffstat (limited to 'llvm/lib/CodeGen/CallingConvLower.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CallingConvLower.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/CallingConvLower.cpp b/llvm/lib/CodeGen/CallingConvLower.cpp index bfb6ba10234..7768e28979c 100644 --- a/llvm/lib/CodeGen/CallingConvLower.cpp +++ b/llvm/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. |