basic asm and memory clobbers
Andrew Haley
aph@redhat.com
Tue Nov 17 09:27:00 GMT 2015
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.
More information about the Gcc
mailing list