public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "hstong at ca dot ibm.com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/52291] New: __sync_fetch_and_add and friends poorly specified for pointer types Date: Fri, 17 Feb 2012 00:37:00 -0000 [thread overview] Message-ID: <bug-52291-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52291 Bug #: 52291 Summary: __sync_fetch_and_add and friends poorly specified for pointer types Classification: Unclassified Product: gcc Version: 4.6.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned@gcc.gnu.org ReportedBy: hstong@ca.ibm.com CC: michaelw@ca.ibm.com Host: powerpc64-unknown-linux-gnu Target: powerpc64-unknown-linux-gnu The documentation states, regarding the __sync_fetch_and_X builtins: These builtins perform the operation suggested by the name, and returns the value that had previously been in memory. That is, { tmp = *ptr; *ptr op= value; return tmp; } { tmp = *ptr; *ptr = ~(tmp & value); return tmp; } // nand For pointer types (which GCC accepts for these builtins) the "operation suggested by the name" leans toward pointer arithmetic; however, the pointer types are not suitable for these operations in C/C++.
next reply other threads:[~2012-02-17 0:35 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-02-17 0:37 hstong at ca dot ibm.com [this message] 2012-02-17 0:41 ` [Bug c/52291] " redi at gcc dot gnu.org 2012-02-17 1:00 ` hstong at ca dot ibm.com 2012-02-17 9:03 ` mikpe at it dot uu.se
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=bug-52291-4@http.gcc.gnu.org/bugzilla/ \ --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).