-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Medium
-
Code Generation Tools
-
CODEGEN-9779
-
-
-
default
The attached test case defines and uses a global array and a function local static array. Build it ...
% tiarmclang -S file.c
Inspect the assembly to see these lines for the definition of the static array ...
.section .data.fxn.static_array,"aw",%progbits
.p2align 2
fxn.static_array:
.zero 400
Compare that to the definition of the global array ...
.comm global_array,400,4
It's in the common section, which eventually becomes .bss.
The 400 bytes of zero in the .data section is a waste of memory. It would be better for the static array to be in .bss, and then get zero initialized by the startup code.