This is the mail archive of the
mailing list for the GCC project.
Re: Implement C11 _Atomic
- From: Andrew MacLeod <amacleod at redhat dot com>
- To: Hans-Peter Nilsson <hp at bitrange dot com>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 21 Nov 2013 18:31:56 -0500
- Subject: Re: Implement C11 _Atomic
- Authentication-results: sourceware.org; auth=none
- References: <Pine dot LNX dot 4 dot 64 dot 1311052316480 dot 30260 at digraph dot polyomino dot org dot uk> <alpine dot BSF dot 2 dot 02 dot 1311210545480 dot 43309 at arjuna dot pair dot com> <528E1C0A dot 7020907 at redhat dot com> <alpine dot BSF dot 2 dot 02 dot 1311211010210 dot 53151 at arjuna dot pair dot com> <528E2CB6 dot 7020104 at redhat dot com> <alpine dot BSF dot 2 dot 02 dot 1311211758050 dot 26167 at arjuna dot pair dot com>
On 11/21/2013 06:23 PM, Hans-Peter Nilsson wrote:
All we need is a way to communicate the atomic property to the type
within the libstdc++ template... We cant use _Atomic there :-P
On Thu, 21 Nov 2013, Andrew MacLeod wrote:
I can bootstrap and check this on x86 to make sure it doesnt affect anything,
and you can fool with it and see if you can get your desired results with your
For the record, tested together with the attached patch for the
CRIS ports, both regularly (not finished, but done with the C
testsuite part and no regressions there), as well as manually
for the attached test-programs, compiling and inspecting output
for different sub-targets and checking that data layout,
alignment and size is as intended.
Too bad about the libstdc++ atomics, but with this/these patches
at least I'll be able to tell people that _Atomic for C11 works.
Thanks to the both of you!
I originally had created an __attribute__ ((atomic)) whch you could
apply to the atomic template type and get the same behaviour as
_Atomic, Im not sure if there is another way or not. The atomic
template is generic, so I couldn't think of any special macro wizardry
we could define...