[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Save RAMPZ register in interrupt handler routines
From: |
Anatoly Sokolov |
Subject: |
Re: [avr-gcc-list] Save RAMPZ register in interrupt handler routines |
Date: |
Thu, 31 Jan 2008 19:59:46 +0300 |
----- Original Message -----
From: <address@hidden>
To: <address@hidden>
Sent: Thursday, January 31, 2008 7:14 PM
Subject: Re: [avr-gcc-list] Save RAMPZ register in interrupt handler
routines
> The perfect way to handle RAMPZ is declare it as fixed register to GCC.
> Then for each instruction pattern that modifies it, add the required
> clobber, set or use of that register.
> Epilog and prolog can then check to see if RAMPZ is modfied and save it.
>
Yes it is the best way, and it will be necessary to do so.
> However, it would seem that just checking for r30,r31 usage in
> prolog/epilog is an easier method that achieve some of the benefits.
>
> RAMPZ will erroneously be saved when the usage of R30,r31 is innocent - or
> the function calls ANY other function (since r30,R31 is a call used
> register and assumed to be modified by any called function)
>
>
If in interrupt handler routines function is called, thet the RAMPZ register
should be kept, it is not known, the RAMPZ register changes or not in this
function. Yes I agree, simple check on use of R30, R31 registers, can give
false positive result.
Anatoly.