avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] saving __zero_reg__ in interrupt


From: Frieder Ferlemann
Subject: Re: [avr-gcc-list] saving __zero_reg__ in interrupt
Date: Tue Jan 30 06:21:04 2001

Hi Marek,

> > both gcc 2.97 and 2.95 save, clear and restore the __zero_reg__
> > in interrupt routines. (-->6 Bytes for each interrupt).
> > Saving/restoring seems redundant as this register
> > should hold (holds) zero anyway.
> It is not - some code (generated by avr-gcc, or hand-optimized assembler)
> uses this register as a second temporary register (it's OK as long as you
> zero it after use).  Interrupt comes in at the right moment (when r1 is
> nonzero) and you lose.

... seems I'm looking for trouble:) 
I did a scan with grep r1 *.lst and grep __zero_ *.lst over my listfiles
und luckily my code doesn't modify this register. 
Guess my C-source is not too exotic:)
So it would work for me right now (TM).

> Don't ;)
it shurely is not wise to switch saving and restoring off,
without knowing when the compiler inserts it, but...

Bye

Frieder



reply via email to

[Prev in Thread] Current Thread [Next in Thread]