This is the mail archive of the
mailing list for the GCC project.
Re: basic asm and memory clobbers
- From: Jeff Law <law at redhat dot com>
- To: Andrew Haley <aph at redhat dot com>, David Wohlferd <dw at LimeGreenSocks dot com>, Richard Henderson <rth at redhat dot com>, Jakub Jelinek <jakub at redhat dot com>
- Cc: Segher Boessenkool <segher at kernel dot crashing dot org>, "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: Mon, 23 Nov 2015 13:37:53 -0700
- 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> <20151120153431 dot GJ5675 at tucnak dot redhat dot com> <564F46CF dot 2030403 at redhat dot com> <564FB2ED dot 70803 at LimeGreenSocks dot com> <56506A03 dot 7030609 at LimeGreenSocks dot com> <5652E4A6 dot 9090905 at redhat dot com>
On 11/23/2015 03:04 AM, Andrew Haley wrote:
Exactly. In retrospect, I probably should have generated more tests for
those conditions back in '99. Essentially they'd document a class of
problems we'd like to fix over time.
On 21/11/15 12:56, David Wohlferd wrote:
So, what now?
While I'd like to take the big step and start kicking out warnings for
non-top-level right now, that may be too bold for phase 3. A more
modest step for v6 would just provide a way to find them (maybe
something like -Wnon-top-basic-asm or -Wonly-top-basic-asm) and doc the
current behavior as well as the upcoming change.
Warnings would be good.
My warning still holds: there are modes of compilation on some
machines where you can't clobber all registers without causing reload
failures. This is why Jeff didn't fix this in 1999. So, if we really
do want to clobber "all" registers in basic asm it'll take a lot of
I know some have been addressed in various forms, but it hasn't been
My recommendation here is to:
1. Note in the docs what the behaviour should be. This guides where
we want to go from an implementation standpoint. I think it'd be fine
to *suggest* only using old style asms at the toplevel, but I'm less
convinced that mandating that restriction is wise.
2. As we come across failures for adhere to the desired behaviour,
fix or document them as known inconsistencies. If we find that some
are inherently un-fixable, then we'll need to tighten the docs around
The more I think about it, I'm just not keen on forcing all those
old-style asms to change.