With PICC18 8.20 PL3 and OSSPEEDUP_QUEUING defined, and optimization disabled, the compiler will generate bad code for qins.c, apparently in both OSInsDelayQ and OSInsPrioQ.
I haven't spent the time to try to track the problem down beyond this. Optimizing qins.c or disabling OSSPEEDUP_QUEUING results in correct code.