Hi All,
I've run into some strange behavior with CCS 3.3.82.32 with Code Generation Tools of 4.6.4 (4.6.6 too). I noticed this issue when I added a new static array to a file within my project. The first indication of a problem was that my compile time for the file with the new array (in Release mode) went from 2 seconds to ~5 minutes. Additionally, some time critical code changed its behavior - taking longer at times. I was able to narrow down when the really slow compile time occurs, it occurs only when -o3 optimization is selected for the problem file AND when the new static array is declared greater than 4 bytes. This array declaration is in a region of code where I'm declaring and data aligning several arrays as follows:
...
#pragma DATA_ALIGN (VideoIn_Buffer0,32)
static Uint8 VideoIn_Buffer0[153600];
#pragma DATA_ALIGN (VideoIn_Buffer1,32)
static Uint8 VideoIn_Buffer1[153600];
#pragma DATA_ALIGN (VideoIn_Buffer2,32)
static Uint8 VideoIn_Buffer2[153600];
#pragma DATA_ALIGN (Video_Snapshot,256)
Uint8 Video_Snapshot[3840000];
#pragma DATA_ALIGN (WirelessFwcsBuffer,32)
static Uint8 WirelessFwcsBuffer[4]; //changing the size of this array from '4' to '5' causes the havoc
.....
I've not found anything obvious...such as I was overrunning the allocated memory. I've tried changing the order of these arrays.
When I compare the .map files (size of array = 4 vs size of array = 5), the .bss shows a significant difference in the location of the .obj of the problem file.
The size-of-4 version compile/link shows the file being spilt up as follows:
.bss 0 804d0000 07733b86 UNINITIALIZED
804d0000 037fc800 App Mem.obj (.bss:_CombinedBuffers)
83ccc800 02800000 App Mem.obj (.bss:_ImageFileBuffer)
864cc800 00960000 App Mem.obj (.bss:_AudioBuffer)
86e2c800 003a9800 App Mem.obj (.bss:_Video_Snapshot)
...
...
878fccc0 00025800 App Mem.obj (.bss:_VideoIn_Buffer0)
879224c0 00025800 App Mem.obj (.bss:_VideoIn_Buffer1)
87947cc0 00025800 App Mem.obj (.bss:_VideoIn_Buffer2)
...
8796d500 00023280 App Mem.obj (.bss:_TVideo_FrameIndexBuffer)
Whereas the size-of-5 version compile/link lumps everything together contiguously:
.bss 0 804d0000 07733cfa UNINITIALIZED
804d0000 06d9ae00 App Mem.obj (.bss)
I'm hoping is that someone will recognize this as a known issue and that there might be a fairly simple workaround. I'm reluctant to upgrade to CCS v4.x or v5.x at this point in the project.
Is there a known limit/bug in CCS v3.3 for data aligning arrays that is connected to the -o3 compile optimization?
Regards,
Rod
...