This is the mail archive of the
mailing list for the GCC project.
Re: basic asm and memory clobbers
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Richard Henderson <rth at redhat dot com>
- Cc: David Wohlferd <dw at LimeGreenSocks 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: Fri, 27 Nov 2015 11:44:58 -0600
- Subject: Re: basic asm and memory clobbers
- Authentication-results: sourceware.org; auth=none
- References: <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> <20151120152039 dot GA15922 at gate dot crashing dot org> <564F3C6E dot 5010908 at redhat dot com>
On Fri, Nov 20, 2015 at 04:29:50PM +0100, Richard Henderson wrote:
> On 11/20/2015 04:20 PM, Segher Boessenkool wrote:
> >Should asm("bla"); then be an extended asm with no input, no outputs,
> >no (non-automatic) clobbers? That would be the most straightforward and
> >logical semantics, but will it break user code?
> I'm suggesting that we don't accept that at all inside a function. One
> must audit the source and make a conscious decision to write asm("bla" : );
I have now audited all code involving RTL's ASM_INPUT (i.e. the basic asm),
and those work identically to zero-operand no-clobber volatile ASM_OPERANDS
(i.e., extended asm) everywhere. Well, two exceptions: the mep port does
not handle that second form (which can never happen currently), and the
ia64 port treats the two forms differently for its placing of stop bits.
So as far as RTL is concerned, we do not need to force users' source code
changes for transitioning to "no more basic asm".
Now looking at what happens before RTL... probably more exciting ;-)