|
From: | Harald Kipp |
Subject: | [avr-gcc-list] Re: maga256 patch for GCC 4.2 |
Date: | Thu, 03 May 2007 13:18:53 +0200 |
User-agent: | Thunderbird 1.5.0.10 (Windows/20070221) |
Sorry, I should have been more precise. If I remember correctly, the stack pointer hadn't been simply _adjusted_ to make room for local variables but had been _overridden_ to _fixed_ address. Fixed in the sense of that it is impossible to specify the stack location at runtime, which is fortunately offered by the .init segments. Dynamic determination of the stack at runtime is most useful to run the same firmware on different hardware layouts and sometimes for multithreading extensions (in my case).1. ...why this implies to modify the stack pointer on entry. This spoils any the stack pointer modification in the .init segment.In begining of 'main' function stack pointer should be modifed for reservation of space for 'main' local variables in stack. Modification of stack pointer can be excluded only if 'main' don't have local variables.
2. ...your statement about "In oficial GCC 4.x main() do not converted to a normal function." I'm sure that in official GCC main() is always a subroutine and always returns an int.No. Oficial GCC jump to main.
Then I was wrong here. Sorry for any confusion. Harald
[Prev in Thread] | Current Thread | [Next in Thread] |