|Subject:||Re: [avr-gcc-list] Long prologue/epilogue sequences|
|Date:||Wed, 20 Apr 2005 09:24:46 +0200|
|User-agent:||Mozilla Thunderbird 1.0.2 (Windows/20050317)|
Simon Han wrote:
One thing I don't understand is why all these register pushes. Wouldn't it be more efficient to only push the ones that SIGNAL uses? It seems to me that when there is function call in SIGNAL handler, there will be at least 12 register pushes/pops. When there is no function in SIGNAL handler, the register pushes are like normal function calls with "reti".Could someone point me the documentation that talks about the reason and/or possible solution to this?
If the function called in the SIGNAL handler is in the same source file and declared as 'static' (if possible), the code size will be reduced since the compiler has all the information to know where a register is really used
Also if the function to call can be defined as 'inline', you will reduce the code size for the signal handler (but grow the global code size of the project if this function is used somewhere else)
I suppose that things are done the way you describe since when a function is called in a signal handler, and unless this function is defined as static and/or inline, the compiler can not know what register will be used: a function can call a function that calls another function, etc.
May be all this is more efficient with gcc-4.0 since the optimizer has been deeply changed...
|[Prev in Thread]||Current Thread||[Next in Thread]|