This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/54087] __atomic_fetch_add does not use xadd instruction
- From: "amacleod at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 01 Oct 2012 15:50:26 +0000
- Subject: [Bug target/54087] __atomic_fetch_add does not use xadd instruction
- Auto-submitted: auto-generated
- References: <bug-54087-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54087
--- Comment #9 from Andrew Macleod <amacleod at redhat dot com> 2012-10-01 15:50:26 UTC ---
Author: amacleod
Date: Mon Oct 1 15:50:09 2012
New Revision: 191929
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191929
Log:
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.
Added:
trunk/gcc/testsuite/gcc.dg/pr54087.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/optabs.c
trunk/gcc/testsuite/ChangeLog