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/TMS320F28377D: Compiler TI v6.4.3: wrong stack management in procedure call

Part Number: TMS320F28377D

Tool/software: TI C/C++ Compiler

We are using CCS 6.1.0.00104 and compiler TI v6.4.3 for TMS320F28x DSPs.

We have noticed a strange repeatable behavior of this compiler. Consider the following code:

 

typedef unsigned int uint16_t ;

typedef unsigned long uint32_t;

uint16_t parA = 94U;

uint16_t parB16 = 6U;

uint32_t parB32 = 6U;

 

void foo(uint16_t a, uint32_t b){

               /* do something */

}

 

Looking inside the generated assembler, it seems that the compiler performs a wrong behavior if foo() is called using not casted values because it puts on the stack the shortest word and within the procedure gets from the stack a word with proper size.

For example:

foo(94U, 6U);   /*>>> error <<<<*/

foo(94U, 66000U);   /*OK*/

foo((uint16_t)94U, (uint32_t) 6U);   /* OK */

foo(parA, parB16);   /*OK*/

foo(parA, parB32);   /*OK*/

Is this kind of wrong behavior described somewhere in Texas Instruments documentation?

Where can we find the list of similar issues in Texas Instruments documentation?

Can this compiler considered safe?

 

Best regards,

Nicola