[Top][All Lists]

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

Re: [avr-gcc-list] Unnecessary mov to temp register in inline funct.

From: Joerg Wunsch
Subject: Re: [avr-gcc-list] Unnecessary mov to temp register in inline funct.
Date: Mon, 6 Jan 2003 17:01:12 +0100 (MET)

Christian Vogel <address@hidden> wrote:

>   mov  r24,r21  ; data32_0(r21) --> r24
>   sbis 0x0b,5   ; <--+
>   rjmp .-4      ; ---+ while(! USR & BV(UDRE) );
>   out  0x06,r24 ; r24 --> UDR
> What I would preferrably use is just out 0x06,r21 and forget the first mov.
> Can I do something (besides making this short function a #define, this
> get's rid of the temp register) to make this inline-function not use the
> temp-register or is the assemly of an inline function fixed as soon
> as it's defined so gcc really *HAS* to use this fixed register r24?

My guess is that the move from r21 to r24 is actually the "calling
sequence" of the (otherwise inlined) function.  r24 is the first
parameter register.  Apparently, gcc "passes" the data in the usual
registers even when inlining a function.

J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/
avr-gcc-list at http://avr1.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]