This is the mail archive of the
mailing list for the GCC project.
Re: basic asm and memory clobbers - Proposed solution
- From: Jeff Law <law at redhat dot com>
- To: Joseph Myers <joseph at codesourcery dot com>, David Wohlferd <dw at LimeGreenSocks 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>, rth at redhat dot com, 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>, aph at redhat dot com, 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, 1 Dec 2015 20:41:22 -0700
- 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>
On 12/01/2015 04:25 PM, Joseph Myers wrote:
Isn't "asm" conditionally supported for ISO C++? In which case it's not
mandatory and semantics are implementation defined.
On Tue, 1 Dec 2015, David Wohlferd wrote:
Saying it's dead in the docs is the first step to making it dead in the code.
This patch just implements an optional warning (unless #3,4 crank it up to a
default warning), but the intent is that eventually (v7? v8?) this turns into
a fatal error.
I am strongly skeptical of this whole direction. As I noted, the basic
asm syntax is part of the standard C++ syntax. We should define it to do
something sensible consistent with existing practice. (That does not
exclude a non-default warning, not part of -Wall or -Wextra, for people
who wish to avoid basic asm in functions.)
So we have a lot of leeway in what we do.
My strong preference is still to document the desired semantics for GCC
and treat anything that does not adhere to those semantics as a bug.
I think a non-default warning is fine. A default warning (or
-Wall/-Westra) is probably undesirable, though I'm still willing to be
convinced either way on that.