jyknight added a comment.

In D57450#1641190 <https://reviews.llvm.org/D57450#1641190>, @lenary wrote:

> @jyknight I hear where you're coming from. I'll see what I can do about the 
> psABI document.
>
> In that ticket, it's mentioned that the Darwin ABI explicitly says that 
> non-power-of-two atomic types should be padded and realigned, but I cannot 
> find any documentation explaining this. That would be useful, given 
> presumably GCC does have to pad/align on Darwin.


AFAIK, there is no such documentation, at least publicly. Possibly Apple has 
some internally, but I suspect it more likely just some in-person conversation 
or something.

GCC is not really supported on Darwin, so I suspect it just gets it wrong.

> Then the only outstanding question relates to zero-sized atomics, which GCC 
> does not pad, but I think Clang has to pad to get the semantics correct, 
> based on this comment: 
> https://github.com/llvm/llvm-project/blob/master/clang/lib/AST/ASTContext.cpp#L2176

The semantics in GCC are that you can create such an object, but any attempt to 
load or store it will result in a compile-time error. E.g., "error: argument 1 
of ‘__atomic_load’ must be a pointer to a nonzero size object". So I don't 
think there's really an issue there.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D57450



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to