This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add atomic type qualifier
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Andrew MacLeod <amacleod at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, <hp at bitrange dot com>
- Date: Sun, 28 Jul 2013 19:34:12 +0000
- Subject: Re: [PATCH] Add atomic type qualifier
- References: <51F2AEB1 dot 60408 at redhat dot com>
On Fri, 26 Jul 2013, Andrew MacLeod wrote:
> What it doesn't do:
* It doesn't implement the stdatomic.h header - do you intend that to be
provided by GCC or glibc?
(Substantive review of the full patch still to come.)
> * It doesn't implement the C11 expression expansion into atomic built-ins.
> ie, you can't write:
> _Atomic int x;
> x = 0;
> and have the result be an atomic operation calling __atomic_store (&x,
> 0). That will be in a follow on patch. So none of the expression expansion
> from C11 is included yet. This just enables that.
The hardest part will probably be compound assignment to an atomic object
where either operand of the assignment has floating-point type - see C11
footnote 113, but you can't actually use feholdexcept or feclearexcept or
feupdateenv here because that would introduce libm dependencies, so back
ends will need to provide appropriate insn patterns to do those operations
inline.
--
Joseph S. Myers
joseph@codesourcery.com