compile bug of S32DS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

compile bug of S32DS

Jump to solution
1,352 Views
fyw
Contributor IV

i use S32DS(Version: 1.1 ) to develop program on MPC5775K, and find it seems  there is  a compile bug of the code.

The source code and its assemble code lists below. (The program has attached!)

 

194621_194621.PNGS32DS_Bug.PNG

 

The compile use r31 and r0 for localDW->ISV_RadarEnSwitch_prev and localDW->ISV_RadarEnSwitch_start.

But from previous program r11 store the value of localDW->ISV_RadarEnSwitch_start and  r12 store the value 

localDW->ISV_RadarEnSwitch_prev.  

 

 

Can anyone help me for that?  Thank you very much!

Original Attachment has been moved to: GccTestProject_Z4.rar

0 Kudos
1 Solution
1,201 Views
alexanderfedoto
NXP Employee
NXP Employee

Please update to S32DS for Power 1.2. Along with a lot of IDE fixes it also has a lot of fixes in compiler codegen. Here is a snip from your project with new compiler:

00000000 <APP_Lib_RFM_SS_5>:
  h_u16 rtu_NSA_GearPosVal, h_f32 rtu_NSA_VehicleSpeedVal, h_bool
  rtu_NSA_TrailerSignalVal, h_u16 rtu_FCM_FailureClass, h_bool
  rtu_DSM_DOWEnable, h_bool rtu_DSM_RPCEnable, h_bool
  rtu_ISV_RadarEnSwitch, B_RFM_SS_5_APP_Lib_T *localB, DW_RFM_SS_5_APP_Lib_T
  *localDW)
{
   0:     18 21 06 f0      e_stwu  r1,-16(r1)
   4:     1b c1 09 08      e_stmw  r30,8(r1)
   8:     30 01 00 23      e_lbz   r0,35(r1)
   c:     ca 71            se_lwz  r7,40(r1)
   e:     7c 1f 07 74      extsb   r31,r0
       /* Abs: '<S203>/Abs' */
       rtb_Abs = (h_f32)fabs(rtu_RCM_FastRadius);

       /* Chart: '<S203>/Switch2Level' */
       /* Gateway: APP_Lib/RFM_SS_5/RFM_Lib/Switch2Level */
       localDW->ISV_RadarEnSwitch_prev = localDW->ISV_RadarEnSwitch_start;
  12:     31 67 00 1f      e_lbz   r11,31(r7)
  16:     7d 7e 07 74      extsb   r30,r11
  1a:     35 67 00 1e      e_stb   r11,30(r7)
       localDW->ISV_RadarEnSwitch_start = rtu_ISV_RadarEnSwitch;
  1e:     34 07 00 1f      e_stb   r0,31(r7)

     if (localDW->is_c14_APP_Lib == APP_Lib_IN_OFF_m) {
  22:     a5 07            se_lhz  r0,10(r7)
  24:     18 20 a8 00      e_cmpi  cr1,r0,0
  28:     7a 06 00 2a      e_bne   cr1,52 <APP_Lib_RFM_SS_5+0x52>
         /* During 'OFF': '<S205>:1' */
         if ((localDW->ISV_RadarEnSwitch_prev != localDW->ISV_RadarEnSwitch_start) &&
  2c:     0c fe            se_cmp  r30,r31
  2e:     7a 12 00 18      e_beq   46 <APP_Lib_RFM_SS_5+0x46>
  32:     2a 1f            se_cmpi r31,1
  34:     7a 02 00 12      e_bne   46 <APP_Lib_RFM_SS_5+0x46>
             (localDW->ISV_RadarEnSwitch_start == RFM_SW_ON)) {
           /* Transition: '<S205>:6' */
           localDW->is_c14_APP_Lib = APP_Lib_IN_ON_g;
  38:     48 16            se_li   r6,1
  3a:     b5 67            se_sth  r6,10(r7)

           /* Entry 'ON': '<S205>:2' */
           localB->RFM_RadarEnSwitch = RFM_SW_ON;
  3c:     c9 71            se_lwz  r7,36(r1)
  3e:     96 67            se_stb  r6,6(r7)
         } else {
           localB->RFM_RadarEnSwitch = RFM_SW_OFF;
         }
         return H_FALSE;

View solution in original post

0 Kudos
2 Replies
1,202 Views
alexanderfedoto
NXP Employee
NXP Employee

Please update to S32DS for Power 1.2. Along with a lot of IDE fixes it also has a lot of fixes in compiler codegen. Here is a snip from your project with new compiler:

00000000 <APP_Lib_RFM_SS_5>:
  h_u16 rtu_NSA_GearPosVal, h_f32 rtu_NSA_VehicleSpeedVal, h_bool
  rtu_NSA_TrailerSignalVal, h_u16 rtu_FCM_FailureClass, h_bool
  rtu_DSM_DOWEnable, h_bool rtu_DSM_RPCEnable, h_bool
  rtu_ISV_RadarEnSwitch, B_RFM_SS_5_APP_Lib_T *localB, DW_RFM_SS_5_APP_Lib_T
  *localDW)
{
   0:     18 21 06 f0      e_stwu  r1,-16(r1)
   4:     1b c1 09 08      e_stmw  r30,8(r1)
   8:     30 01 00 23      e_lbz   r0,35(r1)
   c:     ca 71            se_lwz  r7,40(r1)
   e:     7c 1f 07 74      extsb   r31,r0
       /* Abs: '<S203>/Abs' */
       rtb_Abs = (h_f32)fabs(rtu_RCM_FastRadius);

       /* Chart: '<S203>/Switch2Level' */
       /* Gateway: APP_Lib/RFM_SS_5/RFM_Lib/Switch2Level */
       localDW->ISV_RadarEnSwitch_prev = localDW->ISV_RadarEnSwitch_start;
  12:     31 67 00 1f      e_lbz   r11,31(r7)
  16:     7d 7e 07 74      extsb   r30,r11
  1a:     35 67 00 1e      e_stb   r11,30(r7)
       localDW->ISV_RadarEnSwitch_start = rtu_ISV_RadarEnSwitch;
  1e:     34 07 00 1f      e_stb   r0,31(r7)

     if (localDW->is_c14_APP_Lib == APP_Lib_IN_OFF_m) {
  22:     a5 07            se_lhz  r0,10(r7)
  24:     18 20 a8 00      e_cmpi  cr1,r0,0
  28:     7a 06 00 2a      e_bne   cr1,52 <APP_Lib_RFM_SS_5+0x52>
         /* During 'OFF': '<S205>:1' */
         if ((localDW->ISV_RadarEnSwitch_prev != localDW->ISV_RadarEnSwitch_start) &&
  2c:     0c fe            se_cmp  r30,r31
  2e:     7a 12 00 18      e_beq   46 <APP_Lib_RFM_SS_5+0x46>
  32:     2a 1f            se_cmpi r31,1
  34:     7a 02 00 12      e_bne   46 <APP_Lib_RFM_SS_5+0x46>
             (localDW->ISV_RadarEnSwitch_start == RFM_SW_ON)) {
           /* Transition: '<S205>:6' */
           localDW->is_c14_APP_Lib = APP_Lib_IN_ON_g;
  38:     48 16            se_li   r6,1
  3a:     b5 67            se_sth  r6,10(r7)

           /* Entry 'ON': '<S205>:2' */
           localB->RFM_RadarEnSwitch = RFM_SW_ON;
  3c:     c9 71            se_lwz  r7,36(r1)
  3e:     96 67            se_stb  r6,6(r7)
         } else {
           localB->RFM_RadarEnSwitch = RFM_SW_OFF;
         }
         return H_FALSE;
0 Kudos
1,201 Views
fyw
Contributor IV

Thank you very much!

0 Kudos