public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/50123] New: cmpxchg generated for atomic and with zero/or with -1
@ 2011-08-19  1:14 bonzini at gnu dot org
  2011-08-19  7:29 ` [Bug target/50123] " jakub at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bonzini at gnu dot org @ 2011-08-19  1:14 UTC (permalink / raw)
  To: gcc-bugs

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-11-19 15:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-19  1:14 [Bug target/50123] New: cmpxchg generated for atomic and with zero/or with -1 bonzini at gnu dot org
2011-08-19  7:29 ` [Bug target/50123] " jakub at gcc dot gnu.org
2011-11-29 21:06 ` amacleod at redhat dot com
2013-11-19 15:13 ` bonzini at gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).