public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jfb at chromium dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/66881] Possibly inefficient std::atomic<int> codegen on x86 for simple arithmetic
Date: Mon, 20 Jul 2015 21:57:00 -0000	[thread overview]
Message-ID: <bug-66881-4-UcHARZTDjX@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-66881-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66881

JF Bastien <jfb at chromium dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jfb at chromium dot org

--- Comment #6 from JF Bastien <jfb at chromium dot org> ---
I don't think this is a duplicate of PR 50677: this issue uses two *separate*
atomic operations, which inherently aren't atomic, whereas PR 50677 uses a
single volatile operations which some (misguided) developers expect to be
atomic.

The compiler may decide to be nice to developers who have misguided
expectations from using volatile, but this example clearly uses separate
load/store operations. I believe Thomas is correct: the code for f() should
codegen the same code as g().


      parent reply	other threads:[~2015-07-20 21:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-15 16:05 [Bug middle-end/66881] New: " tkoeppe at google dot com
2015-07-15 16:23 ` [Bug middle-end/66881] " hjl.tools at gmail dot com
2015-07-15 16:29 ` ville.voutilainen at gmail dot com
2015-07-15 16:30 ` hjl.tools at gmail dot com
2015-07-15 16:37 ` hjl.tools at gmail dot com
2015-07-15 16:37 ` hjl.tools at gmail dot com
2015-07-20 21:57 ` jfb at chromium dot org [this message]

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-66881-4-UcHARZTDjX@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: link
Be 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).