[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
Fri Jun 16 03:41:09 PDT 2023


chill added inline comments.


================
Comment at: clang/test/CodeGen/aarch64-ABI-align-packed.c:34
 struct aligned_member_8 {
   uint16x8_t M0 __attribute((aligned (8))); // member alignment 16 since __attribute((aligned (n))) sets the minimum alignment
 };
----------------
JiruiWu wrote:
> chill wrote:
> > Don't you mean "`__attribute__((aligned(n)))` cannot decrease the minimum required alignment" ?
> > 
> > 
> I added this comment to explain that the natural alignment of the struct `aligned_member_8` is 16-byte instead of 8-byte. In this test case the alignment of  `M0` is 16 bytes, which is above the minimum required alignment specified by `__attribute__((aligned(8)))`.
Yes, so the `__attribute__` does not actually set the minimum required alignment, 
it sets the member alignment to the maximum of the natural and the specified alignment.


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