https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66200

--- Comment #4 from Sharad Singhai <singhai at gcc dot gnu.org> ---
Author: singhai
Date: Tue Jun  9 06:45:43 2015
New Revision: 224265

URL: https://gcc.gnu.org/viewcvs?rev=224265&root=gcc&view=rev
Log:
Backport r224118 from trunk for Google ref b/20542176 and b/20766120.

Remove TARGET_RELAXED_ORDERING and optimize for weak memory models.


This patch removes the special casing for targets with relaxed
memory ordering and handles guard accesses with equivalent
atomic load acquire operations. In this process we change the
algorithm to load the guard variable with an atomic load that
has ACQUIRE semantics.

This then means that on targets which have weak memory models, the
fast path is inlined and can directly use a load-acquire instruction
where available (and yay! one more hook gone).

2015-06-04  Ramana Radhakrishnan  <ramana.radhakrish...@arm.com>

            PR c++/66192
            PR target/66200
            * doc/tm.texi: Regenerate.
            * doc/tm.texi.in (TARGET_RELAXED_ORDERING): Delete.
            * target.def (TARGET_RELAXED_ORDERING): Likewise.
            * config/alpha/alpha.c (TARGET_RELAXED_ORDERING): Likewise.
            * config/ia64/ia64.c (TARGET_RELAXED_ORDERING): Likewise.
            * config/rs6000/rs6000.c (TARGET_RELAXED_ORDERING): Likewise.
            * config/sparc/linux.h (SPARC_RELAXED_ORDERING): Likewise.
            * config/sparc/linux64.h (SPARC_RELAXED_ORDERING): Likewise.
            * config/sparc/sparc.c (TARGET_RELAXED_ORDERING): Likewise.
            * config/sparc/sparc.h (SPARC_RELAXED_ORDERING): Likewise.
            * system.h (TARGET_RELAXED_ORDERING): Poison.

2015-06-04  Ramana Radhakrishnan  <ramana.radhakrish...@arm.com>

            PR c++/66192
            PR target/66200
            * cp-tree.h (get_guard_cond): Adjust declaration
            * decl.c (expand_static_init): Use atomic load acquire
            and adjust call to get_guard_cond.
            * decl2.c (build_atomic_load_byte): New function.
            (get_guard_cond): Handle thread_safety.
            (one_static_initialization_or_destruction): Adjust call to
            get_guard_cond.

Modified:
    branches/google/gcc-4_9/gcc/config/alpha/alpha.c
    branches/google/gcc-4_9/gcc/config/ia64/ia64.c
    branches/google/gcc-4_9/gcc/config/rs6000/rs6000.c
    branches/google/gcc-4_9/gcc/config/sparc/linux.h
    branches/google/gcc-4_9/gcc/config/sparc/linux64.h
    branches/google/gcc-4_9/gcc/config/sparc/sparc.c
    branches/google/gcc-4_9/gcc/config/sparc/sparc.h
    branches/google/gcc-4_9/gcc/cp/cp-tree.h
    branches/google/gcc-4_9/gcc/cp/decl.c
    branches/google/gcc-4_9/gcc/cp/decl2.c
    branches/google/gcc-4_9/gcc/doc/tm.texi
    branches/google/gcc-4_9/gcc/doc/tm.texi.in
    branches/google/gcc-4_9/gcc/system.h
    branches/google/gcc-4_9/gcc/target.def

Reply via email to