The PIC16F1454 has lots of banks and a little bit of COMMON, so variable placement makes a difference in code speed because of the bank switches or absence thereof.
I have an ISR that needs to be absolutely predictable in how long it takes from trigger to action, where action is one of many things that is determined by a state machine. (more than just the interrupt flags) So there's some conditional logic in between that needs to take exactly the same time regardless of what the main code is at revision <insert number here>.
Using the XC8 PRO compiler version 1.33, I'm not entirely comfortable that it will honor that. It tries to optimize everything holistically, including both the main code and the ISR, and it apparently makes some guesses towards a compromise between everything. Ideally, I want to put all of the variables that are used in the time-critical section of the ISR in COMMON so I don't need bank switches, but XC8 insists on putting some stack and other stuff in there first so that those variables don't fit. If I try to force them in anyway with a near qualifier (and a compiler option to require compliance), it fails with "can't find space..." If I reserve some COMMON space with a linker option, it will quietly honor that by displacing the stack into bank 0, but then the manual placement into the reserved COMMON space seems to generate bank switches, despite being COMMON.
I've asked MCP support about it, and after several weeks they finally said to convert all of my local variables into globals so that there's no stack, and then it should work.
I suppose I can live with the unnecessary bank switches - just tweak my tuning #defines to match - but is there a way to lock down the ISR's timing without them?