This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: basic asm and memory clobbers - Proposed solution
- From: David Wohlferd <dw at LimeGreenSocks dot com>
- To: Andrew Haley <aph at redhat dot com>, Jeff Law <law at redhat dot com>, Joseph Myers <joseph at codesourcery dot com>, rth at redhat dot com
- Cc: Richard Earnshaw <Richard dot Earnshaw at foss dot arm dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Paul_Koning at Dell dot com, jakub at redhat dot com, rth at gcc dot gnu dot org, pinskia at gcc dot gnu dot org, Segher Boessenkool <segher at kernel dot crashing dot org>, Ian Lance Taylor <iant at google dot com>, Sandra Loosemore <sandra at codesourcery dot com>, Hans-Peter Nilsson <hp at bitrange dot com>, bernd dot edlinger at hotmail dot de
- Date: Tue, 15 Dec 2015 14:22:49 -0800
- Subject: Re: basic asm and memory clobbers - Proposed solution
- Authentication-results: sourceware.org; auth=none
- References: <56552209 dot 1020306 at LimeGreenSocks dot com> <56592801 dot 9010606 at LimeGreenSocks dot com> <565DC5F4 dot 6080804 at foss dot arm dot com> <565E1E37 dot 9080609 at LimeGreenSocks dot com> <alpine dot DEB dot 2 dot 10 dot 1512012323160 dot 12604 at digraph dot polyomino dot org dot uk> <565E6862 dot 7070401 at redhat dot com> <566B4BA1 dot 8000509 at LimeGreenSocks dot com> <566BEE35 dot 6070804 at redhat dot com> <566D0CE6 dot 6090905 at LimeGreenSocks dot com> <566E9191 dot 9030106 at redhat dot com>
On 12/14/2015 1:53 AM, Andrew Haley wrote:
> This just seems like another argument for deprecating basic asm and
pushing people to extended.
Yes. I am not arguing against deprecation. We should do that.
You know, there are several people who seem to generally support this
direction. Not enough to call it a consensus, but perhaps the beginning
of one:
- Andrew Haley
- David Wohlferd
- Richard Henderson
- Segher Boessenkool
- Bernd Schmidt
Anyone else want to add their name here?
Maybe it's the implementation details that have other people concerned.
My thought is that for v6 we change the docs to say something like:
---------
Unlike top level, using basic asm within a function is deprecated. No
new code should use this feature, but should use extended asm instead.
Existing code should begin replacing such usage. Instances of affected
code can be found using -Wonly-top-basic-asm. For help making this
conversion, see "How to convert Basic asm to Extended asm."
---------
With this, we only need to add the warning as a non-default. This will
(hopefully) stop new users from using this, and can begin the work of
removing it from existing code.
The problem with that approach is that (I'm told) some people don't read
the docs. Imagine that. Such being the case, they won't even know this
is happening. That's why I think that in the next phase 1 (v7?), we
should change the warning to 'on' by default (or maybe as part of
-Wall?). People will still be able to override it with no-, but at
least it will raise awareness and chase more of it out of people's code.
What about the final step of actually removing support for basic asm in
a function as some people propose? Should we really do this? If so,
when? That's a more difficult question. If we make the warning a
default in v7, then it would be *at least* v8 before this should be
considered. Trying to make any plan that far ahead seems...
optimistic. Perhaps by then we'll have more feedback upon which to make
a decision.
We *could* be more aggressive and start right off with making the
warning 'on' by default. But to give people the best chance to prepare,
perhaps starting with the non-default is best.
Even if we don't all agree about _removing_ "basic asm in a function,"
can we find consensus that having less of it is a good thing? Because
this approach gets us that.
dw