public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gccbugzilla at limegreensocks dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/62109] __gthr_i486_lock_cmp_xchg missing clobber
Date: Mon, 16 Mar 2015 03:53:00 -0000	[thread overview]
Message-ID: <bug-62109-4-dp6AtNGURX@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-62109-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from David <gccbugzilla at limegreensocks dot com> ---
(In reply to Mikael Pettersson from comment #3)
> Do you have a test case which fails without your patch?

I do not.  But this is a "by definition" thing.

This instruction is intended to emulate the Windows InterlockedCompareExchange
instruction (see the comments above the code).  And all Windows Interlocked*
instructions perform an implicit compiler barrier.  After all, it does no good
for the 'lock' prefix to prevent the processor from re-ordering instructions if
the compiler does it while building the code.  Moving loads or stores past this
statement makes a mess of thread synchronization.

That said, this instruction was only intended to be used on Win95 (neither NT
nor Win98 need it).  Not exactly a common platform these days.  But it's
possible someone is still using this, or will copy this asm block for their own
use, so it should still be correct.


  parent reply	other threads:[~2015-03-16  3:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-12 18:07 [Bug target/62109] New: " gccbugzilla at limegreensocks dot com
2015-02-17  6:52 ` [Bug target/62109] " pinskia at gcc dot gnu.org
2015-02-23  7:25 ` gccbugzilla at limegreensocks dot com
2015-02-23 11:23 ` mikpelinux at gmail dot com
2015-03-16  3:53 ` gccbugzilla at limegreensocks dot com [this message]
2015-03-17 13:44 ` ktietz at gcc dot gnu.org
2015-03-17 23:10 ` gccbugzilla at limegreensocks dot com
2015-03-19 10:47 ` ktietz at gcc dot gnu.org
2015-03-19 23:40 ` gccbugzilla at limegreensocks dot com
2015-03-20 12:06 ` ktietz at gcc dot gnu.org
2015-10-23  1:29 ` gccbugzilla at limegreensocks dot com
2015-10-23 10:00 ` ktietz at gcc dot gnu.org
2015-10-25  1:42 ` gccbugzilla at limegreensocks dot com
2022-01-15 13:33 ` [Bug libgcc/62109] " jyong at gcc dot gnu.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=bug-62109-4-dp6AtNGURX@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).