basic asm and memory clobbers - Proposed solution

Jeff Law law@redhat.com
Wed Dec 2 03:41:00 GMT 2015


On 12/01/2015 04:25 PM, Joseph Myers wrote:
> 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.)
Isn't "asm" conditionally supported for ISO C++?  In which case it's not 
mandatory and semantics are implementation defined.

http://en.cppreference.com/w/cpp/language/asm

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.

jeff



More information about the Gcc mailing list