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

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

Re: [avr-gcc-list] SIGNAL and INTERRUPT overhead


From: Royce Pereira
Subject: Re: [avr-gcc-list] SIGNAL and INTERRUPT overhead
Date: Tue, 23 Aug 2005 19:33:01 +0530
User-agent: Opera M2/8.02 (Win32, build 7680)

On Tue, 23 Aug 2005 13:49:32 +0530, Bernard Fouché <address@hidden> wrote:

Benjamin Titzer wrote:


Sounds to me like the design of GCC and the constraints of a particular
calling convention do not allow it to do something smart here. I think the
solution that would satisfy most everyone involved would be for the
compiler to generate code that only saves the state of registers that it
uses (and overwrites) and then restore them upon exit. This is a simple
use-def analysis on the registers and would be simple enough to implement.

I think that gcc optimizer does that, provided that it can get all the information when compiling. If the interrupt handler calls an external function (external to the source file), then the compiler is not able
to know what to save and what not to save, so it saves everything.

That's a big problem with the usual way of building code, with functions or set of related functions in different files. When the compiler groks the files, it does not have all the information that would help it build a much better optimized code.

If a 'callee-saves" convention is followed universally, then the calling function need not know the registers used by the callee, right?

--Royce.



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/




reply via email to

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