2012-10-01 Andrew MacLeod <amacleod@redhat.com>
authoramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 Oct 2012 15:50:09 +0000 (15:50 +0000)
committeramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 Oct 2012 15:50:09 +0000 (15:50 +0000)
commite8c3ebfc583ef96e84086d22413ba40de9cc9ba2
treea9e7aba800558d9f52393d40679b24f9f4b5aa3c
parent8fab1a8b8437f62c5c56f3c0c36b81134e54eec6
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191929 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/optabs.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr54087.c [new file with mode: 0644]