This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/64660] New: [SH] Convert atomic_fetch_<op> to atomic_<op>_fetch
- From: "olegendo at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 18 Jan 2015 21:43:50 +0000
- Subject: [Bug target/64660] New: [SH] Convert atomic_fetch_<op> to atomic_<op>_fetch
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64660
Bug ID: 64660
Summary: [SH] Convert atomic_fetch_<op> to atomic_<op>_fetch
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: olegendo at gcc dot gnu.org
Target: sh*-*-*
Example:
void test2 (volatile int* mem)
{
__atomic_fetch_add (mem, 1, __ATOMIC_ACQ_REL);
}
void test3 (volatile int* mem)
{
__atomic_add_fetch (mem, 1, __ATOMIC_ACQ_REL);
}
The two functions are equivalent, since the result value of __atomic_fetch_add
is not used in test2. In such cases the atomic insn will have an REG_UNUSED
note and the insn can be converted into the shorter __atomic_add_fetch sequence
in the split1 pass.