[PATCH] D103452: [clang] Fix reading long doubles with va_arg on x86_64 mingw

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 2 13:57:47 PDT 2021


rnk added inline comments.


================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:4364-4365
 
   // MS x64 ABI requirement: "Any argument that doesn't fit in 8 bytes, or is
   // not 1, 2, 4, or 8 bytes, must be passed by reference."
   if (isAggregateTypeForABI(Ty) || Ty->isMemberPointerType()) {
----------------
I wonder if we should make the check more general. There are other cases to consider, like `__int128`. How does GCC pass other large types through varargs? It looks to me like clang passes those indirectly, so we could go ahead and check the type size directly without these aggregate checks.

Separately, I think `X86_64ABIInfo::EmitMSVAArg` has a bug, it always passes false for indirect, but it should match this code here exactly. Ideally, they would share an implementation.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103452/new/

https://reviews.llvm.org/D103452



More information about the cfe-commits mailing list