[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Tiny bug with inline funcs
From: |
Larry Barello |
Subject: |
Re: [avr-gcc-list] Tiny bug with inline funcs |
Date: |
Fri, 18 May 2001 07:28:12 -0700 |
Did you tell the in-line asm that Z was clobbered during the call?
asm(...: "z" (angle) : "=r" (whatever) : "z");
There is a nice write up on writing in-line asm at
http://www.egnite.de/ethernut/GCCAVRInlAsmCB.pdf
Cheers!
----- Original Message -----
From: "Ludovic COURTES" <address@hidden>
> Hello,
>
> I noticed a kind of bug with gcc inline funcs. I have two functions
f_sin()
> and f_cos() (they compute cosinus and sinus and return a fixed point
number)
> which are static inline. When I do
> f_cos(angle); f_sin(angle);
> angle is not reloaded in between function calls. The matter is that my
functions
> (which contains inline asm) stores their argument in Z and then modify it
> (thus, input operand constraint is "Z"(angle) ) ; so the second call
doesn't
> have the right value of the argument.