[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


================
@@ -3133,15 +3149,13 @@ Address X86_64ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
 
     // Copy into a temporary if the type is more aligned than the
     // register save area.
-    if (TyAlign.getQuantity() > 8) {
-      Address Tmp = CGF.CreateMemTemp(Ty);
+    if (neededInt && TyAlign.getQuantity() > 8) {
+      if (!Tmp.isValid())
+        Tmp = CGF.CreateMemTemp(Ty);
       CGF.Builder.CreateMemCpy(Tmp, RegAddr, TySize, false);
----------------
efriedma-quic wrote:

Did you mean to put the memcpy inside the if?  Also, please add a test for this,

https://github.com/llvm/llvm-project/pull/90389


More information about the cfe-commits mailing list