This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: basic asm and memory clobbers
- From: David Wohlferd <dw at LimeGreenSocks dot com>
- To: Hans-Peter Nilsson <hp at bitrange dot com>
- Cc: Segher Boessenkool <segher at kernel dot crashing dot org>, Richard Henderson <rth at redhat dot com>, Andrew Haley <aph at redhat dot com>, Jeff Law <law at redhat dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, rth at gcc dot gnu dot org, pinskia at gcc dot gnu dot org, Sandra Loosemore <sandra at codesourcery dot com>
- Date: Thu, 26 Nov 2015 17:03:43 -0800
- Subject: Re: basic asm and memory clobbers
- Authentication-results: sourceware.org; auth=none
- References: <564A4AA5 dot 1080706 at redhat dot com> <564AC155 dot 4040601 at LimeGreenSocks dot com> <564B9CB1 dot 1060001 at redhat dot com> <564E762B dot 6070705 at LimeGreenSocks dot com> <564EF338 dot 4030703 at redhat dot com> <564EF7FF dot 1070107 at LimeGreenSocks dot com> <564F008B dot 8040703 at redhat dot com> <564F1436 dot 2060005 at LimeGreenSocks dot com> <564F1A7D dot 9050607 at redhat dot com> <alpine dot BSF dot 2 dot 02 dot 1511260518001 dot 40802 at arjuna dot pair dot com> <20151126123540 dot GA21046 at gate dot crashing dot org> <alpine dot BSF dot 2 dot 02 dot 1511261108001 dot 76040 at arjuna dot pair dot com> <56577F5F dot 3010007 at LimeGreenSocks dot com> <alpine dot BSF dot 2 dot 02 dot 1511261819460 dot 549 at arjuna dot pair dot com>
>> To be clear, wouldn't asm("":) have the same effect?
>
> That does not matter. It'd require source-code changes to
> users' code.
My suggestion was to allow the exception to the "basic asm in a
function" warning, but change the docs to show using the new syntax.
This does not require any user code change. But it kinda does matter
whether or not it will work.
Copy/pasting my suggestion:
1) Change the docs to say asm("":), so future coders will do "the right
thing."
2) Allow the exception for v6.
3) Re-evaluate if-and-when we continue with the deprecation process.
It may not be clear from this, but I don't expect step 3 to happen until
at least v7.
And saying "the right thing" may be a bit flip. But if deprecating
basic asm is the path we are choosing, then telling users to use this
syntax is how the text should read. Assuming it works.
> BTW, does that syntax work for really olden gcc
> (say 2.95 era)?
The oldest docs I can find are 2.95.3, and they talk about the extended
asm syntax, so I assume so:
https://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_4.html#SEC93
> Either way, we promised 'asm("")'. I'm pretty
> sure the empty string is identifiable.
It is. I've already updated my code to support this exception.
dw