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.

Reply via email to