Compiler generates different assembly Windows versus Linux

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low

      The attached source file has the following on line 285.

          aGlobalV[u8EEPwwww].dfdsf_u16o = (uint16)(((**ppu32RH)&0xFFFF0000U)>>16U);
      

      Build on Windows and on Linux.

      % armcl -@options.txt file.c
      

      Compare the assembly code generated for line 285. Here it is from Windows.

      ;----------------------------------------------------------------------
      ; 285 | aGlobalV[u8EEPwwww].dfdsf_u16o = (uint16)(((**ppu32RH)&0xFFFF0000U)>>16
      ;     | U);                                                                    
      ;----------------------------------------------------------------------
             LDR       V9, [SP, #32]         ; [DPU_V7R4_PIPE0] |285| 
              LDR       V9, [V9, #0]          ; [DPU_V7R4_PIPE0] |285| 
              LDRB      A1, [SP, #51]         ; [DPU_V7R4_PIPE0] |285| 
              LDR       V9, [V9, #0]          ; [DPU_V7R4_PIPE0] |285| 
              MOV       A2, #212              ; [DPU_V7R4_PIPE1] |285| 
              LDR       A3, $C$CON14          ; [DPU_V7R4_PIPE0] |285| 
              SMULBB    A1, A2, A1            ; [DPU_V7R4_PIPE0] |285| 
              BFC       V9, #0, #16           ; [DPU_V7R4_PIPE0] |285| 
              MOV       V9, V9, LSR #16       ; [DPU_V7R4_PIPE0] |285| 
              STRH      V9, [A3, +A1]         ; [DPU_V7R4_PIPE0] |285| 
      

      Here it is from Linux.

      ;----------------------------------------------------------------------
      ; 285 | aGlobalV[u8EEPwwww].dfdsf_u16o = (uint16)(((**ppu32RH)&0xFFFF0000U)>>16
      ;     | U);                                                                    
      ;----------------------------------------------------------------------
              LDR       V9, [SP, #32]         ; [DPU_V7R4_PIPE0] |285| 
              LDRB      A1, [SP, #51]         ; [DPU_V7R4_PIPE0] |285| 
              LDR       V9, [V9, #0]          ; [DPU_V7R4_PIPE0] |285| 
              LDR       A2, $C$CON15          ; [DPU_V7R4_PIPE0] |285| 
              MOV       A3, #212              ; [DPU_V7R4_PIPE1] |285| 
              LDR       A4, $C$CON14          ; [DPU_V7R4_PIPE0] |285| 
              SMULBB    A1, A3, A1            ; [DPU_V7R4_PIPE0] |285| 
              LDR       V9, [V9, #0]          ; [DPU_V7R4_PIPE0] |285| 
              AND       V9, A2, V9            ; [DPU_V7R4_PIPE0] |285| 
              MOV       V9, V9, LSR #16       ; [DPU_V7R4_PIPE0] |285| 
              STRH      V9, [A4, +A1]         ; [DPU_V7R4_PIPE0] |285| 
      

      The build uses no optimization.  Add --opt_level=2, and the generated assembly is the same.

            Assignee:
            TI User
            Reporter:
            TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                Connection: Intermediate to External PROD System
                EXTSYNC-5892 - Compiler generates different assemb...
                SYNCHRONIZED
                • Last Sync Date: