[PATCH] D146242: [ARM] Fixing ABI mismatch for packed structs passed as function arguments

Momchil Velikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 26 04:06:05 PDT 2023


chill added inline comments.


================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:5813
         getContext().getTypeUnadjustedAlignInChars(Ty).getQuantity();
-    unsigned BaseAlign = getContext().getTypeAlignInChars(Base).getQuantity();
-    Align = (Align > BaseAlign && Align >= 16) ? 16 : 0;
+    Align = (Align >= 16) ? 16 : 8;
     return ABIArgInfo::getDirect(
----------------
The backend ought to set the minimum alignment of a stack slot to 8 anyway (for AAPCS), hence setting the minimum here to 8 is redundant.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146242



More information about the cfe-commits mailing list