[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191213104706.xnpqaehmtean3mkd@ltop.local>
Date: Fri, 13 Dec 2019 11:47:06 +0100
From: Luc Van Oostenryck <luc.vanoostenryck@...il.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Will Deacon <will@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Michael Ellerman <mpe@...erman.id.au>, dja@...ens.net,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linuxppc-dev@...ts.ozlabs.org,
Christophe Leroy <christophe.leroy@....fr>,
linux-arch <linux-arch@...r.kernel.org>,
Mark Rutland <mark.rutland@....com>,
Segher Boessenkool <segher@...nel.crashing.org>,
Arnd Bergmann <arnd@...db.de>,
Christian Borntraeger <borntraeger@...ibm.com>
Subject: Re: READ_ONCE() + STACKPROTECTOR_STRONG == :/ (was Re: [GIT PULL]
Please pull powerpc/linux.git powerpc-5.5-2 tag (topic/kasan-bitops))
On Thu, Dec 12, 2019 at 09:53:38PM +0100, Peter Zijlstra wrote:
> Now, looking at the current GCC source:
>
> https://github.com/gcc-mirror/gcc/blob/97d7270f894395e513667a031a0c309d1819d05e/gcc/c/c-parser.c#L3707
>
> it seems that __typeof__() is supposed to strip all qualifiers from
> _Atomic types. That lead me to try:
>
> typeof(_Atomic typeof(p)) __p = (p);
>
> But alas, I still get the same junk you got for ool_store_release() :/
I was checking this to see if Sparse was ready to support this.
I was a bit surprised because at first sigth GCC was doing as
it claims (typeof striping const & volatile on _Atomic types)
but your exampe wasn't working. But it's working if an
intermediate var is used:
_Atomic typeof(p) tmp;
typeof(tmp) __p = (p);
or, uglier but probably more practical:
typeof(({_Atomic typeof(p) tmp; })) __p = (p);
Go figure!
OTOH, at least on GCC 8.3, it seems to always do the same with
volatiles than it does with consts.
-- Luc Van Oostenryck
Powered by blists - more mailing lists