[Bug inline-asm/34177] Inline assembly uses wrong register

2007-11-21 Thread pinskia at gcc dot gnu dot org


--- 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);


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
  Component|c   |inline-asm
 Resolution||INVALID


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



[Bug inline-asm/34177] Inline assembly uses wrong register

2007-11-21 Thread pete at highdesertsoftware dot net


--- 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 ldsr24, 0x04CC
 64e:38 17   cpr19, r24
 650:10 f4   brcc.+4  ; 0x656 HDStos_Tick+0x64
{
/* Pass the new thread index in r25 */

asm volatile(movr25, %0 : =r (RunTsk)::r25);
 652:98 2f   movr25, 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



[Bug inline-asm/34177] Inline assembly uses wrong register

2007-11-21 Thread pinskia at gcc dot gnu dot org


--- Comment #7 from pinskia at gcc dot gnu dot org  2007-11-21 20:42 ---
Oh you are not storing to RunTsk but to r25 so your constraints are incorrect
still.
Try:
asm volatile(mov   r25, %0 : : r (RunTsk):r25);

This still makes the bug invalid.


-- 


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



[Bug inline-asm/34177] Inline assembly uses wrong register

2007-11-21 Thread pete at highdesertsoftware dot net


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

Thank you so much.  That fixed it.  Sorry to bother you with user error. 

It worked in 3.4.6, the last version of WinAVR I installed, that is why 
I assumed a bug.

I've read and re-read about inline assembler and I just don't get it.  
Is there a place with tons and tons of examples?
Thanks again.
-Pete


pinskia at gcc dot gnu dot org wrote:
 --- Comment #7 from pinskia at gcc dot gnu dot org  2007-11-21 20:42 
 ---
 Oh you are not storing to RunTsk but to r25 so your constraints are incorrect
 still.
 Try:
 asm volatile(mov   r25, %0 : : r (RunTsk):r25);

 This still makes the bug invalid.


   


-- 


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