5.1.2.1 Reentrancy
MPLAB XC8 C Compiler does not support function reentrancy for all devices.
This divergence from the C standard is due to there being no hardware implementation of a data stack on some devices. See 5.7 Stacks for more information on the stack models used by the compiler for each device family.
Functions can be encoded reentrantly for Enhanced Mid-range and PIC18 devices, provided that the software stack is used for data. Recursive functions are also possible with these devices. Baseline and other Mid-range devices do not support a software stack and functions cannot be made reentrant.
For those devices that do not support reentrancy or if you stipulate that functions must use the compiled stack, the compiler can make functions called from main-line and interrupt code appear to be reentrant via a duplication feature. See 5.9.7 Function Duplication for more about duplication.