This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/50123] New: cmpxchg generated for atomic and with zero/or with -1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50123

             Bug #: 50123
           Summary: cmpxchg generated for atomic and with zero/or with -1
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: bonzini@gnu.org


int x;
int f()
{
        return __sync_fetch_and_and(&x, 0);
}
int g()
{
        return __sync_fetch_and_or(&x, -1);
}

f and g can be optimized to atomic xchg on x86.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]