From e3592e196a92f72d6195023b24f4d1aab9c64242 Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Thu, 21 May 2015 13:18:25 -0400 Subject: [PATCH] re PR target/66224 (PowerPC _GLIBCXX_READ_MEM_BARRIER too weak) PR target/66224 * config/cpu/powerpc/atomic_word.h (_GLIBCXX_READ_MEM_BARRIER): Don't use isync. Use lwsync if available. * configure.host (atomic_word_dir) [aix[56789]*]: Delete to use powerpc cpu definition. From-SVN: r223496 --- libstdc++-v3/ChangeLog | 10 +++++++++- libstdc++-v3/config/cpu/powerpc/atomic_word.h | 3 ++- libstdc++-v3/configure.host | 1 - 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 3b44f54e91f..6f2c465a7d1 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,9 +1,17 @@ +2015-05-21 David Edelsohn + + PR target/66224 + * config/cpu/powerpc/atomic_word.h (_GLIBCXX_READ_MEM_BARRIER): + Don't use isync. Use lwsync if available. + * configure.host (atomic_word_dir) [aix[56789]*]: Delete to use + powerpc cpu definition. + 2015-05-21 Jason Merrill * libsupc++/del_opv.cc: Suppress -Wsized-deallocation. * libsupc++/del_op.cc: Likewise. -2015-05-20 François Dumont +2015-05-20 François Dumont fdumont@gcc.gnu.org> * include/debug/formatter.h (_GLIBCXX_TYPEID): New macro to simplify usage of typeid. diff --git a/libstdc++-v3/config/cpu/powerpc/atomic_word.h b/libstdc++-v3/config/cpu/powerpc/atomic_word.h index e044ccdddd7..1ceb02cf702 100644 --- a/libstdc++-v3/config/cpu/powerpc/atomic_word.h +++ b/libstdc++-v3/config/cpu/powerpc/atomic_word.h @@ -27,10 +27,11 @@ typedef int _Atomic_word; -#define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("isync":::"memory") #ifdef __NO_LWSYNC__ +#define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("sync":::"memory") #define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("sync":::"memory") #else +#define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("lwsync":::"memory") #define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("lwsync":::"memory") #endif diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host index 465a40a437e..8892f31f274 100644 --- a/libstdc++-v3/configure.host +++ b/libstdc++-v3/configure.host @@ -219,7 +219,6 @@ case "${host_os}" in # Newer versions of AIX only support PowerPC architecture, so use # atomic instructions directly. os_include_dir="os/aix" - atomic_word_dir="os/aix" ;; aix4.[3456789]*) # We set os_include_dir to os/aix only on AIX 4.3 and newer, but -- 2.30.2