public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "sje at cup dot hp dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/42869] GOMP_critical_start wrong on Itanium due to __sync miscompilation
Date: Tue, 09 Mar 2010 23:25:00 -0000	[thread overview]
Message-ID: <20100309232523.3613.qmail@sourceware.org> (raw)
In-Reply-To: <bug-42869-6957@http.gcc.gnu.org/bugzilla/>



------- Comment #2 from sje at cup dot hp dot com  2010-03-09 23:25 -------
I think the code is wrong.  Looking at ToT, config/ia64/sync.md will generate
the code shown where the memory fence is in front of the cmpxchg4.rel
instruction.

cmpxchg4.rel has release semantics which are defined in the Itanium manual as:
"Release instructions guarentee that all previous orderable instructions are
made visible prior to being made visible themselves."  This would imply to me
that the memory fence before the cmpxchg4.rel is not needed but we do need one
after it in order to prevent things being moved up ahead of the cmpxchg4.rel. 
Alternatively, we could change to code to use cmpxchg4.acq instead of
cmpxchg4.rel and keep the memory fence where it is.  cmpxchg4.acq has acquire
semantics instead of release semantics.


-- 


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


  parent reply	other threads:[~2010-03-09 23:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-26  2:12 [Bug c/42869] New: " Hans dot Boehm at hp dot com
2010-01-26 12:06 ` [Bug target/42869] " rguenth at gcc dot gnu dot org
2010-03-09 23:25 ` sje at cup dot hp dot com [this message]
2010-03-09 23:33 ` jakub at gcc dot gnu dot org
2010-03-09 23:49 ` sje at cup dot hp dot com
2010-03-12 18:19 ` sje at gcc dot gnu dot org
2010-03-12 18:23 ` sje at cup dot hp dot com
2010-07-21 22:38 ` sje at gcc dot gnu dot org

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=20100309232523.3613.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: 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).