[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1186912053.3852.9.camel@localhost>
Date: Sun, 12 Aug 2007 11:47:33 +0200
From: Martin Schwidefsky <schwidefsky@...ibm.com>
To: Segher Boessenkool <segher@...nel.crashing.org>
Cc: wjiang@...ilience.com,
Linus Torvalds <torvalds@...ux-foundation.org>,
wensong@...ux-vs.org, heiko.carstens@...ibm.com,
linux-kernel@...r.kernel.org, ak@...e.de, cfriesen@...tel.com,
netdev@...r.kernel.org, horms@...ge.net.au,
akpm@...ux-foundation.org, Chuck Ebbert <cebbert@...hat.com>,
davem@...emloft.net, zlynx@....org, Chris Snook <csnook@...hat.com>
Subject: Re: [PATCH] make atomic_t volatile on all architectures
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.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists