netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: wjiang@resilience.com,
	Linus Torvalds <torvalds@linux-foundation.org>,
	wensong@linux-vs.org, heiko.carstens@de.ibm.com,
	linux-kernel@vger.kernel.org, ak@suse.de, cfriesen@nortel.com,
	netdev@vger.kernel.org, horms@verge.net.au,
	akpm@linux-foundation.org, Chuck Ebbert <cebbert@redhat.com>,
	davem@davemloft.net, zlynx@acm.org,
	Chris Snook <csnook@redhat.com>
Subject: Re: [PATCH] make atomic_t volatile on all architectures
Date: Sun, 12 Aug 2007 11:47:33 +0200	[thread overview]
Message-ID: <1186912053.3852.9.camel@localhost> (raw)
In-Reply-To: <a599bc5062d557db46496f0d7c7886b0@kernel.crashing.org>

On Sun, 2007-08-12 at 07:53 +0200, Segher Boessenkool wrote:
> > Yes, though I would use "=m" on the output list and "m" on the input
> > list. The reason is that I've seen gcc fall on its face with an ICE on
> > s390 due to "+m". The explanation I've got from our compiler people was
> > quite esoteric, as far as I remember gcc splits "+m" to an input 
> > operand
> > and an output operand. Now it can happen that the compiler chooses two
> > different registers to access the same memory location. "+m" requires
> > that the two memory references are identical which causes the ICE if
> > they are not.
> 
> The problem is very nicely described here, last paragraph:
> <http://gcc.gnu.org/ml/gcc-patches/2007-07/msg01816.html>
> 
> It's not a problem anymore in (very) recent GCC, although
> that of course won't help you in the kernel (yet).

So you are saying that gcc 3.x still has this problem ?

> > I do not know if the current compilers still do this. Has
> > anyone else seen this happen ?
> 
> In recent GCC, it's actually documented:
> 
> 	 The ordinary output operands must be write-only; GCC will assume that
> 	the values in these operands before the instruction are dead and need
> 	not be generated.  Extended asm supports input-output or read-write
> 	operands.  Use the constraint character `+' to indicate such an operand
> 	and list it with the output operands.  You should only use read-write
> 	operands when the constraints for the operand (or the operand in which
> 	only some of the bits are to be changed) allow a register.
> 
> Note that last line.

I see, thanks for the info. 

-- 
blue skies,
  Martin.

"Reality continues to ruin my life." - Calvin.



  parent reply	other threads:[~2007-08-12  9:44 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-08 23:07 [PATCH] make atomic_t volatile on all architectures Chris Snook
2007-08-08 23:18 ` Jesper Juhl
2007-08-08 23:31   ` Chris Snook
2007-08-08 23:51     ` Jesper Juhl
2007-08-08 23:25 ` Lennert Buytenhek
2007-08-08 23:35   ` Chris Snook
2007-08-09  1:03 ` Herbert Xu
2007-08-09  1:48   ` David Miller
2007-08-09  3:47     ` Paul E. McKenney
2007-08-09  7:47   ` Chris Snook
2007-08-09  8:30     ` Herbert Xu
2007-08-09 11:44       ` Chris Snook
2007-08-09  4:18 ` Linus Torvalds
2007-08-09  4:59   ` Jerry Jiang
2007-08-09  7:31   ` Chris Snook
2007-08-09  8:14     ` Heiko Carstens
2007-08-09 17:36     ` Chuck Ebbert
2007-08-09 17:55       ` Linus Torvalds
2007-08-09 18:20         ` Martin Schwidefsky
2007-08-12  5:53           ` Segher Boessenkool
2007-08-12  6:09             ` Linus Torvalds
2007-08-12  9:48               ` Martin Schwidefsky
2007-08-12  9:54                 ` Linus Torvalds
2007-08-12 16:30                 ` Segher Boessenkool
2007-08-12 18:11                   ` Linus Torvalds
2007-08-12 19:13                     ` Segher Boessenkool
2007-08-12 10:27               ` Segher Boessenkool
2007-08-12 17:59                 ` Linus Torvalds
2007-08-12  9:47             ` Martin Schwidefsky [this message]
2007-08-12 10:35               ` Segher Boessenkool
2007-08-09 17:57       ` Martin Schwidefsky
     [not found] <8Q2Pg-8uV-23@gated-at.bofh.it>
     [not found] ` <8Q7Fa-7rJ-1@gated-at.bofh.it>
     [not found]   ` <8Q8rD-hh-7@gated-at.bofh.it>
2007-08-09  9:10     ` Bodo Eggert
2007-08-09  9:18       ` Jerry Jiang
2007-08-09 15:00         ` Linus Torvalds

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=1186912053.3852.9.camel@localhost \
    --to=schwidefsky@de.ibm.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=cebbert@redhat.com \
    --cc=cfriesen@nortel.com \
    --cc=csnook@redhat.com \
    --cc=davem@davemloft.net \
    --cc=heiko.carstens@de.ibm.com \
    --cc=horms@verge.net.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=segher@kernel.crashing.org \
    --cc=torvalds@linux-foundation.org \
    --cc=wensong@linux-vs.org \
    --cc=wjiang@resilience.com \
    --cc=zlynx@acm.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 NNTP newsgroup(s).