This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/TMS320F28035: Unused code can take the .ebss space with optimization

Part Number: TMS320F28035

Tool/software: TI C/C++ Compiler

Create a new project on CCS (only a “main” function),compiler Version is V17.9.0 or V18.12,add a new file,paste the following code :


static long DummyDMXs[1] = {255};


#ifndef DMX_BUNCH
#define DMX_BUNCH(i) DummyDMXs[i-i]
#endif

void LedBunchsMacroScriptRGBW00(int nextFrame)
{
static long r,g,b,w;
long LedBunchsMacroTick;

LedBunchsMacroTick = 0;

DMX_BUNCH(4 * LedBunchsMacroTick ) = r;
DMX_BUNCH(4 * LedBunchsMacroTick + 1) = g;
DMX_BUNCH(4 * LedBunchsMacroTick + 2) = b;
DMX_BUNCH(4 * LedBunchsMacroTick + 3) = w;

}

compile it with “Release” configuration,or other optimization level 。

And this new file take the .ebss space,I can see it from the “Memory Allocation” view. Is it a bug?

thanks a lot!

I come from China,can i speak chinese here?