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/TMS320C6674: incorrect optimized code using enums with o2

Part Number: TMS320C6674

Tool/software: TI C/C++ Compiler

The issue can be discribed with a very simple snippet of code:

void miniTestCode(){

    enum myEnum{};
    
    myEnum enumVal = (myEnum) 0x89000;

    unsigned int maskedVal =(myEnum)(enumVal & 0x3FFFF);//corrupt with o2 !!! no mask seen

    printf("miniTestCode enumVal = 0x%x, maskedVal = 0x%x", enumVal,maskedVal);
}

the expected output would be "miniTestCode enumVal = 0x89000, maskedVal = 0x9000"

this is the case when compiled with CCS6 TI v8.1.0 without optimization

compiled with o2 the output is "miniTestCode enumVal = 0x89000, maskedVal = 0x89000".

Is this a known issue ?

regards ti_andreas