Actions

icon Post
text/html Subscribe
text/html Unsubscribe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [coldfire-gnu-discuss] Inline Assembly


  • To: Corrin Meyer <Corrin.Meyer@xxxxxxxxxxxxxxx>
  • Subject: Re: [coldfire-gnu-discuss] Inline Assembly
  • From: Daniel Jacobowitz <dan@xxxxxxxxxxxxxxxx>
  • Date: Tue, 5 Aug 2008 10:18:55 -0400

On Tue, Aug 05, 2008 at 09:58:46AM -0400, Corrin Meyer wrote:
>         : "=d" (old_ipl) : "d" (_ipl) : "%%d7" );

You need =&d, not =d.  From the GCC manual:

 Unless an output operand has the `&' constraint modifier, GCC may
allocate it in the same register as an unrelated input operand, on the
assumption the inputs are consumed before the outputs are produced.
This assumption may be false if the assembler code actually consists of
more than one instruction.  In such a case, use `&' for each output
operand that may not overlap an input.  *Note Modifiers::.

-- 
Daniel Jacobowitz
CodeSourcery