This is the mail archive of the
mailing list for the GCC project.
Re: basic asm and memory clobbers - Proposed solution
- From: Joseph Myers <joseph at codesourcery dot com>
- To: David Wohlferd <dw at LimeGreenSocks dot com>
- Cc: Andrew Haley <aph at redhat dot com>, Jeff Law <law at redhat dot com>, <rth at redhat dot com>, 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 22:43:28 +0000
- 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> <567092B9 dot 6020703 at LimeGreenSocks dot com>
On Tue, 15 Dec 2015, David Wohlferd wrote:
> 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."
I think the typical use of basic asm is: you want to manipulate I/O
registers or other such state unknown to the compiler (not any registers
the compiler might use itself), and you want to do it in a way that is
maximally compatible with as many compilers as possible (hence limiting
yourself to the syntax subset that's in the C++ standard, for example).
Compatibility with a wide range of other compilers is the critical thing
here; this is not a GCC-invented feature, and considerations for
deprecating an externally defined feature are completely different from
considerations for GCC-invented features. Do you have evidence that it is
now unusual for compilers to support basic asm without supporting
GCC-compatible extended asm, or that other compiler providers generally
consider basic asm deprecated?
Joseph S. Myers