Using Output Compare Interrupts with PWM
The output compare interrupt flag (OCIF) on PIC32M micros gets asserted only in the 'PWM with fault protection' mode when a logic '0' is detected on the OCFx pin. If you have configured the OC module in 'PWM without fault protection' mode, then you need to use the respective Timer interrupt flag for processing interrupts related to the PWM.
For example, if OC3 is using Timer 2, then the T2IF flag will be set at the end of a PWM cycle.
Refer the "Pulse Width Modulation Mode" section of the "PIC32 FRM Section 16. Output Compare" document.