This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: basic asm and memory clobbers - Proposed solution
- From: <Paul_Koning at Dell dot com>
- To: <bschmidt at redhat dot com>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Tue, 15 Dec 2015 20:42:04 +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> <HE1PR07MB0905876DB6CE2AEBB578DBB6E4EC0 at HE1PR07MB0905 dot eurprd07 dot prod dot outlook dot com> <566E68BF dot 50403 at LimeGreenSocks dot com> <20151214081032 dot GB32573 at gate dot crashing dot org> <56700CF5 dot 4090800 at redhat dot com>
> On Dec 15, 2015, at 7:52 AM, Bernd Schmidt <bschmidt@redhat.com> wrote:
>
> On 12/14/2015 09:10 AM, Segher Boessenkool wrote:
>> That, and adding a memory clobber degrades performance for a lot of
>> existing basic asm that does not expect the clobber, e.g. asm(""),
>> asm("#"), asm("nop"), ...
>
> I wonder about this. People keep bringing up "a lot of existing basic asm" in general, but are there any known examples in real software?
In the codebase for the product I work on, I see about 200 of them. Many of those are the likes of asm("sync") for MIPS, which definitely wants to be treated as if it were asm ("sync" : : : "memory").
That's not counting the hundreds I see in gdb/stubs -- those are "outside a function" flavor.
paul