------- Comment #6 from pete at highdesertsoftware dot net  2007-11-21 20:38 
-------
Subject: Re:  Inline assembly uses wrong register

Thank you for your exceptionally fast response.  However, adding the 
clobber did not help.  The problem, I think, is r19 is used as the local 
variable "RunTsk", yet r24 is what gets moved to r25.  I guess I didn't 
make clear what the problem was.
Another fagment from the lss file. 


    if (RunTsk < gRunningIdx)
     64a:    80 91 cc 04     lds    r24, 0x04CC
     64e:    38 17           cp    r19, r24
     650:    10 f4           brcc    .+4          ; 0x656 <HDStos_Tick+0x64>
    {
        /* Pass the new thread index in r25 */

        asm volatile("mov    r25, %0" : "=r" (RunTsk)::"r25");
     652:    98 2f           mov    r25, r24
        asm volatile("rjmp hdstos_Switch");
     654:    87 cf           rjmp    .-242        ; 0x564 <hdstos_Switch>
    }

Thanks
-Pete


pinskia at gcc dot gnu dot org wrote:
> ------- Comment #5 from pinskia at gcc dot gnu dot org  2007-11-21 18:06 
> -------
> r25 is not marked as clobbered so what do you expect?
> Try:
> asm volatile("mov       r25, %0" : "=r" (RunTsk)::"r25");
>
>
>   


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34177

Reply via email to