 |
|
 |
RENESAS TOOL NEWS [July 1, 2003: RSO-M3T-NC30WA-030701D]
A Note on Using C compiler M3T-NC30WA V.5.10 Release 1
|
Please take note of the following problem in using the M3T-NC30WA C compiler (with an assembler and integrated development environment) for the M16C/60, M16C/30, M16C/20, and M16C/10 series MCUs:
- On calling functions by using the indirection operator
- Description
Calling a function using the indirection operator results in incorrect code being generated.
- Conditions
- This problem occur if the following three conditions are satisfied:
| (1) | Either of the optimizing options -OR and-OS is selected. |
| (2) | Immediately before the ending process of a function A, another function B is called using an indirection operator. |
| (3) | A pointer variable pointing to function B is declared outside of function A. |
- Example
--------------------------------------------------------
void (*sub)(void); /* Condition (3) */
:
void func(void)
{
:
(*sub)(); /* Condition (2) */
}
--------------------------------------------------------
- Workaround
Place a dummy asm function immediately after calling a function using the indirection operator.
--------------------------------------------------------
void (*sub)(void);
:
void func(void)
{
:
(*sub)();
asm(); /* A dummy asm function inserted */
}
--------------------------------------------------------
- Schedule of Fixing the Problem
We plan to fix this problem in our next release of the product.
|
 |