This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: basic asm and memory clobbers
- From: Andrew Haley <aph at redhat dot com>
- To: David Wohlferd <dw at LimeGreenSocks dot com>, Paul_Koning at Dell dot com
- Cc: gcc at gcc dot gnu dot org, Ian Lance Taylor <iant at google dot com>
- Date: Wed, 25 Nov 2015 09:09:25 +0000
- 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> <56537921 dot 9070809 at redhat dot com> <565386CA dot 8080005 at LimeGreenSocks dot com> <C080D84D-C192-46F6-BAE9-9E3B5A9F766C at dell dot com> <5653BFC5 dot 5080305 at LimeGreenSocks dot com> <54275115-454B-4CCB-BEA8-752A14B24E62 at dell dot com> <565518B4 dot 9050701 at LimeGreenSocks dot com>
On 25/11/15 02:11, David Wohlferd wrote:
> The 'fix' I am proposing is to give warnings for every use of basic asm
> inside functions (top-level asm is not a problem).
I'm not sure that's such a great idea on its own.
My suggestion:
1. Clobber memory.
2. Document a rule which says that all registers which are used must be
saved and restored.
This won't break any existing usages, and is AFAICS entirely in the spirit
of what was originally intended and with the ISO C specification.
Andrew.