8 Aug
2018
8 Aug
'18
8:05 p.m.
On Wed, Aug 8, 2018 at 7:02 AM, Andrew Haley <aph@redhat.com> wrote:
On 08/08/2018 07:51 AM, Erik Osterlund wrote:
So basically, my answer to your question is: no we do not and should not care. And that message ought to be documented somewhere to remove all uncertainty and inconsistency around that reoccuring question.
That sounds sensible. I guess that if we use -fno-strict-aliasing then we can cast *T to *atomic<T>. I can ask on gcc@ to be sure.
A difficulty might arise if the representation of atomic<T> is different from T, as might happen if the arch has no atomic instructions for a type of that size and so a lock must be allocated somewhere. I don't know how gcc's atomic builtins deal with that problem.