This is the mail archive of the
mailing list for the GCC project.
Re: basic asm and memory clobbers - Proposed solution
- From: David Wohlferd <dw at LimeGreenSocks dot com>
- To: Paul_Koning at Dell dot com
- Cc: bernd dot edlinger at hotmail dot de, gcc at gcc dot gnu dot org
- Date: Tue, 1 Dec 2015 14:27:34 -0800
- 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> <HE1PR07MB09050E30BB6C251DBB454790E4020 at HE1PR07MB0905 dot eurprd07 dot prod dot outlook dot com> <9EAD225F-1323-439F-B697-C90F86F1D959 at dell dot com> <565B8FE2 dot 7000500 at LimeGreenSocks dot com> <2C1A50C8-AC7B-4E9E-BE5D-8CAB7AB8BDDC at dell dot com>
On 12/1/2015 10:10 AM, Bernd Edlinger wrote:
> And a test case is missing too.
> I think this warning concentrates now only on basic asm.
> And people will be probably fix it in the most easy way,
> by just adding a colon.
Probably true. At least I hope it's that easy for most people.
> But IMHO asm("bla":) isn't any better than asm("bla").
> I think _any_ asm with non-empty assembler string, that
> claims to clobber _nothing_ is highly suspicious, and worth to be
> warned about. I don't see any exceptions from this rule.
There's one right now in the basic asm docs: asm("int $3");
And I've seen others: asm volatile ("nop"), asm(".byte 0xf1\n"). I've
seen a bunch more, but you get the idea.