optabs: ensure atomic_load/stores have compiler barriers
authorAlexander Monakov <amonakov@ispras.ru>
Mon, 4 Sep 2017 10:16:37 +0000 (13:16 +0300)
committerAlexander Monakov <amonakov@gcc.gnu.org>
Mon, 4 Sep 2017 10:16:37 +0000 (13:16 +0300)
commitd8c40eff56f69877b33c697ded756d50fde90c27
treee4a696a0929438cfbf6c366ebc3ea949267a4f51
parent1fda57cb2dc323c7d387ab0df9de708c0889be0d
optabs: ensure atomic_load/stores have compiler barriers

PR rtl-optimization/57448
PR target/67458
PR target/81316
* optabs.c (expand_atomic_load): Place compiler memory barriers if
using atomic_load pattern.
(expand_atomic_store): Likewise.
testsuite/
* gcc.dg/atomic/pr80640-2.c: New testcase.
* gcc.dg/atomic/pr81316.c: New testcase.

From-SVN: r251643
gcc/ChangeLog
gcc/optabs.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/atomic/pr80640-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/atomic/pr81316.c [new file with mode: 0644]