3.6.6.20 ISR Prologues Option
The -m[no-]gas-isr-prologues
option controls the context switch code generated
for small interrupt service routines (ISRs).
If this feature is not enabled, the compiler will save registers R0, R1, and SREG, and clear register R1 in the context save code associated with ISRs and restore these registers in the context restore code. When enabled, this feature will have the assembler scan the ISR for register usage and only save these registers if required. For small ISRs, the result will be smaller and faster executing interrupt code. This feature can be safely used with other compiler features, such as code coverage, stack guidance, and procedural abstraction, which will continue to work as expected.
This feature is automatically enabled at level 1 and higher optimizations (except when
the -Og
option is enabled). It can be disabled for the entire program
by using the -mno-gas-isr-prologues
option; alternatively, it can be
disabled for particular ISRs by using the no_gccisr
function attribute
with that ISR definition.