This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/43404] ARM: Internal compiler error when using '&foo' in naked function
- From: "marti at juffo dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Mar 2010 14:46:37 -0000
- Subject: [Bug target/43404] ARM: Internal compiler error when using '&foo' in naked function
- References: <bug-43404-18353@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from marti at juffo dot org 2010-03-19 14:46 -------
(In reply to comment #5)
> I think the compiler should throw an error if there are any statements in the
> naked function other than asm statements.
This would break a lot of code; there are use cases where you want to
save/restore the stack frame yourself, but still use C code in the middle. And
on ARM you can go a long way without needing to spill over to the stack.
For example:
* Nut/OS context switching code,
http://www.ethernut.de/api/context_8c-source.html#l00156
* Interrupt handlers that use macros which also push r0-r3 and spsr, which
otherwise not stored in GCC's stack frame:
http://www.ethernut.de/api/ih__at91ssc_8c-source.html#l00068
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43404