This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/34177] Inline assembly uses wrong register
- From: "pete at highdesertsoftware dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Nov 2007 20:38:09 -0000
- Subject: [Bug inline-asm/34177] Inline assembly uses wrong register
- References: <bug-34177-15405@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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