This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C28x cgtools 6.01 saving all, even unused, registers in interrupt routine



I am using C28x cgtools 6.01 and observed the following in a very small interrupt routine:

The compiler is saving all, even unused, registers.

Can I somehow avoid this?

 

Here is the code example:

interrupt void EPWM4_INT_ISRa(void)

{
  EALLOW;
  PWMModule3.TripZoneControl.Items.TZA      = PWM_TZ_ACTION_FORCE_LOW;
  PWMModule4.TripZoneControl.Items.TZA      = PWM_TZ_ACTION_NONE;
  PWMModule4.TripZoneClear.AsWord = 0xFFFF;   // Re-enable PWM output + Interrupt
  EDIS;

  PIECtrl.ACK.AsWord = 0xFFFF;    
  PWMModule4.EventTriggerClear.Items.INT = 1;

}
With float_support=fpu32, it leads to

_EPWM4_INT_ISR:
;* AR4   assigned to $O$C1
        ASP       ; [CPU_]
        PUSH      RB                    ; [CPU_]
        MOVL      *SP++,XT              ; [CPU_]
        MOVL      *SP++,XAR4            ; [CPU_]
        MOVL      *SP++,XAR5            ; [CPU_]
        MOVL      *SP++,XAR6            ; [CPU_]
        MOVL      *SP++,XAR7            ; [CPU_]
        MOV32     *SP++,STF             ; [CPU_]
        MOV32     *SP++,R0H             ; [CPU_]
        MOV32     *SP++,R1H             ; [CPU_]
        MOV32     *SP++,R2H             ; [CPU_]
        MOV32     *SP++,R3H             ; [CPU_]
        SETFLG    RNDF32=1, RNDF64=1    ; [CPU_]
        CLRC      PAGE0,OVM             ; [CPU_]
        CLRC      AMODE                 ; [CPU_]
 EALLOW
        MOVL      XAR4,#_PWMModule4     ; [CPU_U] |1177|
        MOVL      XAR5,XAR4             ; [CPU_] |1177|
        ADDB      XAR5,#20              ; [CPU_U] |1177|
        OR        *+XAR5[0],#0x0003     ; [CPU_] |1177|
 EDIS
;----------------------------------------------------------------------
; 1183 | PWMModule4.EventTriggerClear.Items.INT = 1;                           
;----------------------------------------------------------------------
        ADDB      XAR4,#28              ; [CPU_U] |1183|
        OR        *+XAR4[0],#0x0001     ; [CPU_] |1183|
        MOV32     R3H,*--SP             ; [CPU_]
        MOV32     R2H,*--SP             ; [CPU_]
        MOV32     R1H,*--SP             ; [CPU_]
        MOV32     R0H,*--SP             ; [CPU_]
        MOV32     STF,*--SP             ; [CPU_]
        MOVL      XAR7,*--SP            ; [CPU_]
        MOVL      XAR6,*--SP            ; [CPU_]
        MOVL      XAR5,*--SP            ; [CPU_]
        MOVL      XAR4,*--SP            ; [CPU_]
        MOVL      XT,*--SP              ; [CPU_]
        POP       RB                    ; [CPU_]
        NASP      ; [CPU_]
        IRET      ; [CPU_]

The RxH registers and XAR6,7 are definitely not used in the generated code, so why are they saved?