This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Add asm constraint modifier to mark strict memory accesses
- From: Yury Gribov <y dot gribov at samsung dot com>
- To: Jeff Law <law at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>, Richard Henderson <rth at redhat dot com>
- Cc: gcc <gcc at gcc dot gnu dot org>, Konstantin Serebryany <konstantin dot s dot serebryany at gmail dot com>, Dmitry Vyukov <dvyukov at google dot com>, Marat Zakirov <m dot zakirov at samsung dot com>, Andrey Ryabinin <a dot ryabinin at samsung dot com>, Konstantin Khlebnikov <k dot khlebnikov at samsung dot com>
- Date: Thu, 18 Sep 2014 18:38:04 +0400
- Subject: Re: [RFC] Add asm constraint modifier to mark strict memory accesses
- Authentication-results: sourceware.org; auth=none
- References: <541ABD6E dot 3030904 at samsung dot com> <20140918111617 dot GF17454 at tucnak dot redhat dot com> <541ABFCB dot 7050107 at samsung dot com> <541ADFD8 dot 2050306 at redhat dot com>
On 09/18/2014 05:36 PM, Jeff Law wrote:
On 09/18/14 05:19, Yury Gribov wrote:
Would that modifier mean that the inline asm is unconditionally reading
resp. writing that memory? "m"/"=m" right now is always about might
read or might write, not must.
Yes, that's what I had in mind. Many inline asms (at least in kernel) do
read memory region unconditionally.
That's precisely what I'd expect such a modifier to mean. Right now
memory modifiers are strictly "may" but I can see a use case for "must".
I think the question is will the kernel or glibc folks use that new
capability and if so, do we get a significant improvement in the amount
of checking we can do. So I think both those groups need to be looped
into this conversation.
Right. Should I x-post or better send separate emails and then report
feedback on GCC list?
From an implementation standpoint, are you thinking a different
modifier (my first choice)?
So we have constraints ("m", "v", "<", etc.) and modifiers which can be
attached to arbitrary constraints ("+", "=", "&", etc.). I though about
adding a new modifier so that it could be added to arbitrary memory
constraint as needed.
That wouldn't allow us to say something
like the first X bytes of this memory region are written and the
remaining Y bytes may be written, but I suspect that's not a use case
we're likely to care about.
Yeah, I don't think anyone needs this.
-Y