[Bug target/16634] arm-elf-gcc problems when generating code for __attribute__ ((interrupt ("IRQ")))

ralf dot guetlein at web dot de gcc-bugzilla@gcc.gnu.org
Thu Nov 8 21:42:00 GMT 2007



------- 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



More information about the Gcc-bugs mailing list