efriedma added a comment.

> I disagree with this on principle -- IMO, it is basically a historical bug in 
> GCC that it ignores the type alignment, and we should NOT try to match that 
> -- it's dangerous.

gcc has always behaved this way, and I don't see any indication they intend to 
change it.  I mean, you can call it a bug, but at the end of the day the bug 
reports will land in our bugtracker, not gcc's.

> As a workaround: add alignas(uint64_t) to the affected struct in lld. (is 
> GHashCell the only one?)

I think that's the only one, at least according to `git grep std::atomic`; I 
guess that works.  (Assuming you meant `alignas(sizeof(uint64_t))`.)

> Ask GCC to modify libstdc++ so that `__builtin_addressof` is called directly, 
> instead of going through `std::__addressof`.

Even if gcc did this today, it would take years to reach people on Linux.

I guess this is motivation to implement namespaced builtins...?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123642

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

Reply via email to