From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2303 invoked by alias); 19 Mar 2010 14:46:49 -0000 Received: (qmail 2234 invoked by uid 48); 19 Mar 2010 14:46:37 -0000 Date: Fri, 19 Mar 2010 14:46:00 -0000 Message-ID: <20100319144637.2233.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/43404] ARM: Internal compiler error when using '&foo' in naked function In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "marti at juffo dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-03/txt/msg01855.txt.bz2 ------- 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