[PATCH] D125919: Drop qualifiers from return types in C (DR423)
James Y Knight via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 3 13:00:24 PDT 2022
jyknight added a comment.
In D125919#3556754 <https://reviews.llvm.org/D125919#3556754>, @rsmith wrote:
> That assumption does not hold. Given `struct A { char c[3]; };`, `struct A` has size 3 and align 1, but `_Atomic struct A` has size 4 and align 4 across many (perhaps all?) of our targets. (This is an ABI divergence between GCC and Clang, which as far as I know the psABI owners have so far not succeeded in resolving.)
And while GCC indeed never changes the size (that is: it never introduces padding), it, too, increases the alignment when the size was already appropriately-aligned.
That is, given `struct A { char c[4]; };`, `struct A` has size 4 and align 1, but `_Atomic struct A` has size 4 and align 4, under //both// GCC and Clang.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125919/new/
https://reviews.llvm.org/D125919
More information about the cfe-commits
mailing list