From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28492 invoked by alias); 8 Nov 2007 21:42:18 -0000 Received: (qmail 28426 invoked by uid 48); 8 Nov 2007 21:42:09 -0000 Date: Thu, 08 Nov 2007 21:42:00 -0000 Message-ID: <20071108214209.28425.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/16634] arm-elf-gcc problems when generating code for __attribute__ ((interrupt ("IRQ"))) In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ralf dot guetlein at web dot de" 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: 2007-11/txt/msg00748.txt.bz2 ------- Comment #9 from ralf dot guetlein at web dot de 2007-11-08 21:42 ------- (In reply to comment #8) > also fails on 4.2.1 is this bug still present in 4.2.2? Acc. to my obervations the error only shows up when not all auto variables can be mapped to registers, and additional variables are located on stack. As a work-around, if a more complex interrupt handler is needed, place the code in a subfunction and call this function from the interrupt handler. In this case no stack is reserved in the interrupt handler, and the generated code is OK. Care must be taken, of course, that the optimizer does not inline the code for IntFunc(). Example: void IntFunc(void); __attribute__((interrupt("IRQ")) void IntHandler(void) { IntFunc(); } __attribute__(noinline)) void IntFunc(void) { // interrupt code here! } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16634