From: David Edelsohn Date: Fri, 22 May 2015 13:02:34 +0000 (+0000) Subject: re PR target/66224 (PowerPC _GLIBCXX_READ_MEM_BARRIER too weak) X-Git-Tag: releases/gcc-4.9.3~137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e1053ccf3c12cbd34d13130e804bd0c5712e2f6;p=thirdparty%2Fgcc.git 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. From-SVN: r223564 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index b42c6e74ddac..6ac5a4807793 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,12 @@ +2015-05-22 David Edelsohn + + Backport from mainline + 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. + 2015-05-07 Renlin Li Backported from mainline diff --git a/libstdc++-v3/config/cpu/powerpc/atomic_word.h b/libstdc++-v3/config/cpu/powerpc/atomic_word.h index 12eafd8db4f8..1ceb02cf7028 100644 --- a/libstdc++-v3/config/cpu/powerpc/atomic_word.h +++ b/libstdc++-v3/config/cpu/powerpc/atomic_word.h @@ -1,6 +1,6 @@ // Low-level type for atomic operations -*- C++ -*- -// Copyright (C) 2004-2014 Free Software Foundation, Inc. +// Copyright (C) 2004-2015 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -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