re PR target/49244 (__sync or __atomic builtins will not emit 'lock bts/btr/btc')
authorJakub Jelinek <jakub@redhat.com>
Tue, 3 May 2016 11:37:25 +0000 (13:37 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 3 May 2016 11:37:25 +0000 (13:37 +0200)
commitadedd5c173388ae505470df152b9cb3947339566
tree858576e93abb78b087773e895b143546903f49f2
parent50891606a95368edd688fa9dc73003b1dfd68983
re PR target/49244 (__sync or __atomic builtins will not emit 'lock bts/btr/btc')

PR target/49244
* tree-ssa-ccp.c: Include stor-layout.h and optabs-query.h.
(optimize_atomic_bit_test_and): New function.
(pass_fold_builtins::execute): Use it.
* optabs.def (atomic_bit_test_and_set_optab,
atomic_bit_test_and_complement_optab,
atomic_bit_test_and_reset_optab): New optabs.
* internal-fn.def (ATOMIC_BIT_TEST_AND_SET,
ATOMIC_BIT_TEST_AND_COMPLEMENT, ATOMIC_BIT_TEST_AND_RESET): New ifns.
* builtins.h (expand_ifn_atomic_bit_test_and): New prototype.
* builtins.c (expand_ifn_atomic_bit_test_and): New function.
* internal-fn.c (expand_ATOMIC_BIT_TEST_AND_SET,
expand_ATOMIC_BIT_TEST_AND_COMPLEMENT,
expand_ATOMIC_BIT_TEST_AND_RESET): New functions.
* doc/md.texi (atomic_bit_test_and_set@var{mode},
atomic_bit_test_and_complement@var{mode},
atomic_bit_test_and_reset@var{mode}): Document.
* config/i386/sync.md (atomic_bit_test_and_set<mode>,
atomic_bit_test_and_complement<mode>,
atomic_bit_test_and_reset<mode>): New expanders.
(atomic_bit_test_and_set<mode>_1,
atomic_bit_test_and_complement<mode>_1,
atomic_bit_test_and_reset<mode>_1): New insns.

* gcc.target/i386/pr49244-1.c: New test.
* gcc.target/i386/pr49244-2.c: New test.

From-SVN: r235813
12 files changed:
gcc/ChangeLog
gcc/builtins.c
gcc/builtins.h
gcc/config/i386/sync.md
gcc/doc/md.texi
gcc/internal-fn.c
gcc/internal-fn.def
gcc/optabs.def
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr49244-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr49244-2.c [new file with mode: 0644]
gcc/tree-ssa-ccp.c