Subject: Re: EGCS and kernel source
To: Krister Walfridsson <cato@df.lth.se>
From: Todd Whitesel <toddpw@best.com>
List: tech-kern
Date: 11/01/1998 22:01:30
> One asm the current egcs complains on are the following (from pio.h)
> 
> static __inline void
> insb(int port, void *addr, int cnt)
> {
>         __asm __volatile("cld\n\trepne\n\tinsb"                 :
>                                                                 :
>                          "d" (port), "D" (addr), "c" (cnt)      :
>                          "%edi", "%ecx", "memory");
> }

This pio.h example is very close to the VAX movc3 example given at the bottom
of page 179 in the GCC 2.8 edition of "Using and Porting GNU CC" by Stallman.
The legality of clobbers overlapping with input operands is mentioned at the
end of the discussion of 'clobber' on page 293.

> I got the answer
> 
>    You are clobbering ecx and edi explicitly *and* you reference them
>    as an input or an output.  That is wrong.  Clobbers must not overlap
>    with inputs or outputs.  If they do, the compiler will now issue an
>    error.

Either this responder does not understand the full definition of clobbers,
or egcs is providing a different syntax to express an input that is also
clobbered, or egcs has broken this feature relative to GCC 2.8.

Todd Whitesel
toddpw @ best.com