This is the mail archive of the
mailing list for the GCC project.
Re: inline asm clobbers
- From: Jeff Law <law at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>, David Wohlferd <dw at LimeGreenSocks dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Thu, 12 Mar 2015 15:37:19 -0600
- Subject: Re: inline asm clobbers
- Authentication-results: sourceware.org; auth=none
- References: <5500C898 dot 3000601 at LimeGreenSocks dot com> <CAKOQZ8yG4fPx8Ce3JiZMtW8MwXAMFk5W3_JAJ=b2WMQ4mXDDdA at mail dot gmail dot com> <5500E31C dot 4080707 at LimeGreenSocks dot com> <CAKOQZ8zbcYCSKOVfxcrVyb=R6T8dNnfi3e3Erv9s1SZTtu0UhQ at mail dot gmail dot com> <5501FEED dot 3030107 at LimeGreenSocks dot com> <20150312212628 dot GZ1746 at tucnak dot redhat dot com>
On 03/12/15 15:26, Jakub Jelinek wrote:
Yup. And as common as it may be, I find it makes reading the resulting
assembly code far more difficult than it ought to be :(
On Thu, Mar 12, 2015 at 02:02:37PM -0700, David Wohlferd wrote:
To wrap this up:
Like Ian said, the order of registers here apparently never changes. I read
more into that comment than I should have. For good luck, I experimented
with -fomit-frame-pointer, -ffixed-, etc, and nothing has any impact here.
The list is the list.
In fact, it turns out you can use this same format with register variables:
register int x asm("3"); // i386: ebx
On some architectures, like e.g. powerpc, people often just use numbers
instead of say r<number> at least for the general purpose registers and
usually the internal register numbering matches it.
So, while using asm ("3") on x86 is something very unusual, on other targets
it can be quite common.
But I won't start a rant on that issue right now ;-)