[clang] [X86_64] Fix empty field error in vaarg of C++. (PR #90389)
Eli Friedman via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 30 10:42:29 PDT 2024
================
@@ -3122,9 +3122,25 @@ Address X86_64ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
CGF.Builder.CreateStore(V, CGF.Builder.CreateStructGEP(Tmp, 1));
RegAddr = Tmp.withElementType(LTy);
- } else if (neededInt) {
- RegAddr = Address(CGF.Builder.CreateGEP(CGF.Int8Ty, RegSaveArea, gp_offset),
- LTy, CharUnits::fromQuantity(8));
+ } else if (neededInt || neededSSE == 1) {
+ llvm::Value *Offset = neededInt ? gp_offset : fp_offset;
+ uint64_t Alignment = neededInt ? 8 : 16;
+ Address Tmp = Address::invalid();
+ if (AI.isDirect() && AI.getDirectOffset() == 8) {
+ Tmp = CGF.CreateMemTemp(Ty);
+ llvm::StructType *ST = cast<llvm::StructType>(LTy);
----------------
efriedma-quic wrote:
ST is also wrong... please write a few more testcases.
https://github.com/llvm/llvm-project/pull/90389
More information about the cfe-commits
mailing list