This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: asm issues


> > 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]