public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan-Benedict Glaw <jbglaw@microdata-pos.de>
To: Momchil Velikov <velco@fadata.bg>
Cc: linux-kernel@vger.kernel.org
Subject: Re: xchg and GCC's optimisation:-(
Date: Mon, 17 Dec 2001 14:55:52 +0100	[thread overview]
Message-ID: <20011217145551.B518@microdata-pos.de> (raw)
In-Reply-To: <20011217134526.A31801@microdata-pos.de> <87wuzmq91m.fsf@fadata.bg>
In-Reply-To: <87wuzmq91m.fsf@fadata.bg>; from velco@fadata.bg on Mon, Dec 17, 2001 at 03:18:45PM +0200

On Mon, Dec 17, 2001 at 03:18:45PM +0200, Momchil Velikov wrote:
> >>>>> "Jan-Benedict" == Jan-Benedict Glaw <jbglaw@microdata-pos.de> writes:
> Jan-Benedict> I've looked at ./include/asm-i386/system.h which does some black
> Jan-Benedict> magic with it, and I don't really understand that. However, the
> Jan-Benedict> result is that the xchg gets optimized away, rendering at least
> 
> Can you try with this patch ...
> 
> --- system.h.orig.0	Mon Dec 17 15:03:38 2001
> +++ system.h	Mon Dec 17 15:16:58 2001
> @@ -205,21 +205,15 @@ static inline unsigned long __xchg(unsig
>  	switch (size) {
>  		case 1:
>  			__asm__ __volatile__("xchgb %b0,%1"
> -				:"=q" (x)
> -				:"m" (*__xg(ptr)), "0" (x)
> -				:"memory");
> +				     :"+q" (x),"=m" (*__xg(ptr)));
[...]

The patch fixes the problem. Please also send it for inclusion
in 2.2.x, 2.4.x and 2.5.x, because these kernel version will behave
exactly the same (system.h looks very similar between all these
versions...)

MfG, JBG


  reply	other threads:[~2001-12-17 13:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-17 12:45 xchg and GCC's optimisation:-( Jan-Benedict Glaw
2001-12-17 13:18 ` Momchil Velikov
2001-12-17 13:55   ` Jan-Benedict Glaw [this message]
2001-12-17 17:33 ` vda

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=20011217145551.B518@microdata-pos.de \
    --to=jbglaw@microdata-pos.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=velco@fadata.bg \
    /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