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

--- Comment #11 from Michael Schulze <mschulze at ivs dot cs.ovgu.de> 
2010-12-06 09:07:19 UTC ---
(In reply to comment #9)
> This is essentially identical to the patch I provided for
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44617
> so it looks good to me.
I hadn't see that patch but you are right it's almost identical. 

> I had two worries:
> Is R15 used anywhere else in startup code that might not obey the register
> save conventions (ie does do_global_ctors need to preserve R15)
> The AVR has a lot of opcodes that are not valid on registers less than 16.  It
> doesn't look like any of these are used here, but I wasn't 100% positive that
> using R15 wouldn't cause problems...
As far as I know r15 isn't used elsewhere in the start-up code and also your
second worry seems not to be a problem, because such instructions are not used
by that time.


(In reply to comment #10)
> I strongly suggest not using R15. The ATtiny10 Family of devices
> (ATtiny10/4/5/9/20/40) only has R16-R31. So using R15 won't work for this
> class of devices.
I disagree because the additional register is only in the start up code of
devices that have rampz and is omitted in all other cases. The ATtiny don't 
have a rampz (correct me if I'm wrong) thus they are not faced with the 
discussed problem in general. IMO, it is absolutely possible and correct to use 
r15 here. 

> It would be best if we can find a register that will for all AVR
> devices.
Due to the compiler's C calling conventions, there are no other free registers
to use without the need of pushing and popping this registers. Only registers
below r16 are free to use. All other free r16,r17,r28,r29 are already in use.

Reply via email to