[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Problem where R0 gets used
From: |
Erik Christiansen |
Subject: |
Re: [avr-gcc-list] Problem where R0 gets used |
Date: |
Fri, 18 Jan 2008 17:02:56 +1100 |
User-agent: |
Mutt/1.5.9i |
On Fri, Jan 18, 2008 at 12:24:29AM -0500, Andrew Hutchinson wrote:
> I think I have found a bug with avr register allocation.
Maybe not. ;-)
...
> So R0 got trashed.
>
> There will be other examples where this could happen as R0 is used is
> quite a few places to help assembler.
But the avr ABI defines it as volatile, as I understand it. At
http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_reg_usage we
have:
>>>
r0 - temporary register, can be clobbered by any C code (except
interrupt handlers which save it), may be used to remember something
for a while within one piece of assembler code
<<<
Looks like we have licence to trash it.
>
> I can only assume at this time that the same could happen to R1.
Nope, not a safe assumption. It must be restored if fiddled. It is
"assumed to be always zero in any C code".
Erik
- Re: [avr-gcc-list] Success running the testsuite with avrtest, (continued)
- Re: [avr-gcc-list] Success running the testsuite with avrtest, Paulo Marques, 2008/01/16
- Re: [avr-gcc-list] Success running the testsuite with avrtest, Paulo Marques, 2008/01/17
- Re: [avr-gcc-list] Success running the testsuite with avrtest, Dmitry K., 2008/01/17
- Re: [avr-gcc-list] Success running the testsuite with avrtest, Paulo Marques, 2008/01/17
- RE: [avr-gcc-list] Success running the testsuite with avrtest, Weddington, Eric, 2008/01/17
- Re: [avr-gcc-list] Success running the testsuite with avrtest, Dmitry K., 2008/01/17
- RE: [avr-gcc-list] Success running the testsuite with avrtest, Weddington, Eric, 2008/01/17
- Re: [avr-gcc-list] Success running the testsuite with avrtest, Dmitry K., 2008/01/17
- Re: [avr-gcc-list] Success running the testsuite with avrtest, Paulo Marques, 2008/01/17
- [avr-gcc-list] Problem where R0 gets used, Andrew Hutchinson, 2008/01/18
- Re: [avr-gcc-list] Problem where R0 gets used,
Erik Christiansen <=
- Re: [avr-gcc-list] Success running the testsuite with avrtest, Dmitry K., 2008/01/18
- Re: [avr-gcc-list] Success running the testsuite with avrtest, Paulo Marques, 2008/01/18