public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/42553] wrong code with -O1 Date: Wed, 30 Dec 2009 14:33:00 -0000 [thread overview] Message-ID: <20091230143301.14994.qmail@sourceware.org> (raw) In-Reply-To: <bug-42553-5724@http.gcc.gnu.org/bugzilla/> ------- Comment #2 from pinskia at gcc dot gnu dot org 2009-12-30 14:33 ------- The inline-asm is totally incorrect here is the corrected version of the function (note res should be set): static bool atomic_test_and_reset_bit(unsigned long *v,unsigned long bit) { bool res = 0; __asm__ __volatile__( "btr %2,%1\n" "adc $0,%0\n" :"+r"(res): "m"(*v) ,"r"(bit), "r"(0): "flags") ; return res ? 1 : 0; } -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42553
next prev parent reply other threads:[~2009-12-30 14:33 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2009-12-30 12:57 [Bug target/42553] New: " debian-gcc at lists dot debian dot org 2009-12-30 13:14 ` Andrew Pinski 2009-12-30 13:15 ` [Bug target/42553] " pinskia at gmail dot com 2009-12-30 14:33 ` pinskia at gcc dot gnu dot org [this message] 2010-01-04 16:07 ` ubizjak at gmail dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20091230143301.14994.qmail@sourceware.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).