This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Implement C11 _Atomic
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Dominique Dhumieres <dominiq at lps dot ens dot fr>
- Cc: <gcc-patches at gcc dot gnu dot org>, <rth at redhat dot com>, <amacleod at redhat dot com>
- Date: Fri, 8 Nov 2013 13:27:07 +0000
- Subject: Re: Implement C11 _Atomic
- Authentication-results: sourceware.org; auth=none
- References: <20131108130701 dot 84B61104 at mailhost dot lps dot ens dot fr>
On Fri, 8 Nov 2013, Dominique Dhumieres wrote:
> This revision may also causes the failures of
> gfortran.dg/typebound_operator_9.f03 and
> FAIL: gfortran.fortran-torture/execute/forall_1.f90.
I doubt the patch affects Fortran (there are language-independent changes,
but they are fairly small and shouldn't affect code not using _Atomic
qualifiers).
> Undefined symbols for architecture i386:
> "___atomic_compare_exchange_16", referenced from:
> "___atomic_load_16", referenced from:
Either those functions should be in libatomic (using locking where
necessary), or the built-in functions should be expanding to use the
size-generic libatomic function rather than the _16 one. Richard or
Andrew should be able to advise on which the design was for systems that
don't have lock-free atomics for all of the standard sizes (1, 2, 4, 8,
16).
My guess is that it would be hard to provide the _16 functions in
libatomic when TImode types aren't supported, and so the bug is that _16
function calls are generated when not supported. That is, c-common.c
functions resolve_overloaded_atomic_exchange,
resolve_overloaded_atomic_compare_exchange,
resolve_overloaded_atomic_load, resolve_overloaded_atomic_store, where
they check n != 16, should do something like (n != 16 ||
!targetm.scalar_mode_supported_p (TImode)). (Better, refactor the (n != 1
&& n != 2 && n != 4 && n != 8 && n != 16) into an atomic_size_supported_p
or similar function.)
--
Joseph S. Myers
joseph@codesourcery.com