re PR target/54087 (__atomic_fetch_add does not use xadd instruction)
authorAndrew MacLeod <amacleod@redhat.com>
Mon, 1 Oct 2012 15:50:09 +0000 (15:50 +0000)
committerAndrew Macleod <amacleod@gcc.gnu.org>
Mon, 1 Oct 2012 15:50:09 +0000 (15:50 +0000)
commitcd8b6dc554e8ca488ec5d3f975250e29b316397c
treea9e7aba800558d9f52393d40679b24f9f4b5aa3c
parent992103ad6991bfbd908d10b18b3fba28196ff7a8
re PR target/54087 (__atomic_fetch_add does not use xadd instruction)

2012-10-01  Andrew MacLeod  <amacleod@redhat.com>

PR target/54087
* optabs.c (expand_atomic_fetch_op_no_fallback): New.  Factored code
from expand_atomic_fetch_op.
(expand_atomic_fetch_op):  Try atomic_{add|sub} operations in terms of
the other one if direct opcode fails.
* testsuite/gcc.dg/pr54087.c:  New testcase for atomic_sub ->
atomic_add when atomic_sub fails.

From-SVN: r191929
gcc/ChangeLog
gcc/optabs.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr54087.c [new file with mode: 0644]