From: Akira Hatanaka Date: Fri, 12 Aug 2011 02:30:14 +0000 (+0000) Subject: Alignment of a va_arg must be at least as large as the ABI's minimum alignment. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b0a0383ef5ba23cbf2968f7cb314be0b80847e8;p=clang Alignment of a va_arg must be at least as large as the ABI's minimum alignment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137420 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index 87c07b4793..cb5c6722f9 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -3082,6 +3082,7 @@ llvm::Value* MipsABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty, AddrTyped = Builder.CreateBitCast(Addr, PTy); llvm::Value *AlignedAddr = Builder.CreateBitCast(AddrTyped, BP); + TypeAlign = std::max(TypeAlign, MinABIStackAlignInBytes); uint64_t Offset = llvm::RoundUpToAlignment(CGF.getContext().getTypeSize(Ty) / 8, TypeAlign); llvm::Value *NextAddr =