This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: basic asm and memory clobbers
- From: Andrew Haley <aph at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 17 Nov 2015 09:27:30 +0000
- Subject: Re: basic asm and memory clobbers
- Authentication-results: sourceware.org; auth=none
- References: <563FE459 dot 3000003 at LimeGreenSocks dot com> <20151109093229 dot GA5260 at gate dot crashing dot org> <56493010 dot 9070707 at LimeGreenSocks dot com> <564A4AA5 dot 1080706 at redhat dot com> <564AC155 dot 4040601 at LimeGreenSocks dot com>
On 17/11/15 05:55, David Wohlferd wrote:
> How much pessimism are we talking here? Wouldn't clobbering everything
> effectively force the reloading of (some? most? all?) registers? And
> more memory will be needed to store things that used to just require
> registers?
No, really not. It only affects locals whose address has been taken
and is live at that point.
> Along with a few more memory writes? A single line of basic asm,
> even a comment, could have a non-trivial impact on the code that
> gets generated.
>
> One common use I've seen for basic asm is "int $3" on x86 to break into
> the debugger (the basic asm docs use this as a sample). Changing this to
> a clobber-everything will make what used to be a minimally intrusive way
> to debug code into a high impact operation that may obscure the very
> thing being debugged.
I think that's really pretty unlikely. Besides, if you need a
breakpoint for debugging you really don't want operations to move
across that breakpoint.
Andrew.