lkml.org 
[lkml]   [1998]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: egcs 1.0.1 miscompiles Linux 2.0.33
Regarding the documented behaviour of GCC w.r.t. clobbered registers,
Jeffrey A. Law wrote:
> The documentation is a little ambigious, but the natural
> meaning of a clobber would be that it can't be used for an input
> operand *or* in the address of an input operand.

Actually, it's not ambiguous at all. From the 2.7.2 docs (which have not,
I understand, changed this section for 2.8):

> You can put multiple assembler instructions together in a single
> `asm' template, separated either with newlines (written as `\n') or with
> semicolons if the assembler allows such semicolons. The GNU assembler
> allows semicolons and all Unix assemblers seem to do so. The input
> operands are guaranteed not to use any of the clobbered registers, and
> neither will the output operands' addresses, so you can read and write
> the clobbered registers as many times as you like. Here is an example
> of multiple instructions in a template; it assumes that the subroutine
> `_foo' accepts arguments in registers 9 and 10:

> asm ("movl %0,r9;movl %1,r10;call _foo"
> : /* no outputs */
> : "g" (from), "g" (to)
> : "r9", "r10");

That seems pretty unambiguous to me.
--
-Colin

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:41    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site