This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/2] allow certain kinds of inputs to top level asm()-s
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jan Beulich <JBeulich at suse dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 30 Sep 2011 14:47:51 +0200
- Subject: Re: [PATCH 2/2] allow certain kinds of inputs to top level asm()-s
- References: <4E85C79A0200007800058BFC@nat28.tlf.novell.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Sep 30, 2011 at 12:43:54PM +0100, Jan Beulich wrote:
> This is so that use of symbols referenced in these asm()-s can be
> properly tracked by the compiler, just like is the case for all other
> asm()-s. I'm particularly looking forward to use this in the Linux
> kernel. It is certainly not very useful in PIC code, at least not with
> some extra care.
Even in PIC code it can be useful to have toplevel asm like
asm ("..." : : "i" (offsetof (struct S, field)), "i" (some_enum_value), "i" (sizeof (struct S)));
etc.
Jakub