Array created with std::array is mistakenly in a section that is initialized, instead of uninitialized

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: Medium
    • Code Generation Tools
    • CODEGEN-12243
    • Hide
      ARMCLANG_4.0.0.LTS
      ARMCLANG_3.2.0.LTS
      Show
      ARMCLANG_4.0.0.LTS ARMCLANG_3.2.0.LTS
    • ARMCLANG_5.0.0.STS*
    • default
    • This issue can be addressed by specifying the "-fzero-initialized-in-bss" option on the tiarmclang compiler command line.

      The attached test case has these lines ...

      int builtin_array[100];
      std::array<int, 100> std_array;
      

      Build it and search the assembly for the lines that put each array in a section.

      $ tiarmclang -S file.cpp
      
      $ findstr section file.s | findstr array
              .section        .bss.builtin_array,"aw",%nobits
              .section        .data.std_array,"aw",%progbits
      

      The builtin_array is in an uninitialized section. The std_array is in an initialized section. They should both be in an uninitialized section.

            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-4439 - Array created with std::array is mi...
                SYNCHRONIZED
                • Last Sync Date: