Visible to Intel only — GUID: iga1457468847145
Ixiasoft
Visible to Intel only — GUID: iga1457468847145
Ixiasoft
38.8.1.5. Compiler-Related Latency
The GNU C compiler creates a prologue and epilogue for many C functions, including ISRs. The prologue and epilogue are code sequences that take care of housekeeping tasks, such as saving and restoring context for the C runtime environment. The time required for the prologue and epilogue is called compiler-related latency.
The C compiler generates a prologue and epilogue as needed. If compiler optimization is enabled, and the routine is compact, with few local variables, the prologue and epilogue are usually omitted. You can determine whether a prologue and epilogue are generated by examining the function’s assembly code.
Compiler latency normally has only a minor impact on overall interrupt servicing performance. If you are concerned about compiler latency, you have two options:
- Enable compiler optimizations, and simplify your ISR, minimizing local variables.
- Write your ISR in assembly language.