|
From: | Curtis Maloney |
Subject: | Re: [avr-gcc-list] Interrupt prologues |
Date: | Tue, 01 Feb 2005 11:22:38 +1100 |
User-agent: | Mozilla Thunderbird 1.0 (Windows/20041206) |
E. Weddington wrote:
Well it's not "hidden" from GCC. GCC knows about them. But it's part of the ABI that the zero and tmp regs can be used by any function. So, an interrupt happens, and the ISR needs to save and restore it as your generated code in the ISR could use those registers, for example assigning zero to a variable.
The problem is, GCC can see that the other two registers are dirtied in the function, so why can't it also see that tmp and zero aren't dirtied? In the case of the sample I pasted, the function called no others, and did not dirty tmp or zero... so why are they saved?
This is why I thought they might be hidden, and that part of the prologue "hard coded" as a precaution/work around. Otherwise, it's stupid that the compiler tracks every other register that requires saving, but not those two.
-- Curtis Maloney
[Prev in Thread] | Current Thread | [Next in Thread] |