Sparr <[EMAIL PROTECTED]> wrote:

> Why does "foo++;" compile to "subi Rd,lo8(-(1))" instead of "inc
> Rd"?

As I already wrote you on avrfreaks.net, the use of fixed registers is
such a minor issue that nobody bothered to special-case peephole
optimizations for it in AVR-GCC.

If you want an optimal ISR, *and* you already do know which assembly
code to use for that, then just go ahead, and write your entire
charlieplexing ISR in assembly.  This is for sure the most optimal
method just in this case.

The global register variables inside the C code could still prove
useful in that case anyway (provided you compile all your C
compilation units with consistent declarations about them), since that
way, you can ask the compiler to effectively treat these registers as
reserved locations, and not use them.  Of course, you always have to
be careful with library functions in that case, unless you recompile
the library with the same set of global register declarations.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)


_______________________________________________
AVR-GCC-list mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to