This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: asm issues
- To: amylaar at cygnus dot co dot uk, rth at cygnus dot com, torvalds at transmeta dot com, egcs at egcs dot cygnus dot com
- Subject: Re: asm issues
- From: rkennedy at bigbird dot engr dot sgi dot com (Robert Kennedy)
- Date: Tue, 11 May 1999 11:50:59 -0700 (PDT)
- Reply-to: Robert Kennedy <rkennedy at cthulhu dot engr dot sgi dot com>
> > If I'm guessing right, you're proposing some sort of strange thing
> > that lies in between macro substitution for the asm operands and
> > function-argument-like evaluation semantics for them. I propose that
>
> It's how extended asms work. You specify an object with the language
> syntax, and this object is then substituted into the assembler template.
It's how they're implemented in egcs (and maybe gcc), but it isn't
what the gcc extended asm documentation says. The documentation says
that copy-in/copy-out is allowed.
I am proposing that we need some type of qualification that would
disallow it, and it seems to me that volatile should not be overloaded
for that purpose because it already means something different. What
volatile means is "access this object once for each time control flow
passes through a mention of the object." Note that a += b counts as
two mentions of 'a' (one read and one write), but that otherwise the
number of mentions is transparent in the source code.
asm ("foo %0\n foo %0" : : "m" (a)) contains *one* mention of a, not
two. So I would claim that if a is volatile, the compiler must create
a copy to substitute for "%0".
-- Robert