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.

TMS570LS3137: How to make a variable not be optimized

Part Number: TMS570LS3137

Hi Team,

The following variables are defined in CCS. This variable will not appear to be referenced in the program, but it is needed. Found that it would be optimized away by the compiler. How can I keep this variable from being optimized?

const struct soft_info_t softinfo __attribute__((used, section(".softinfo_head_section")))=
{
( unsigned int)app_entry,
( unsigned int)&dataLoadStart,
( unsigned int)&dataRunStart,
( unsigned int)&dataLoadSize
};

Thanks & Regards

Yale Li