 |
|
 |
RENESAS TOOL NEWS [August 16, 2003: RSO-M3T-NC30WA-030816D]
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 writing assignment statements successively
- Description
Writing assignment statements successively results in incorrect code being generated.
- Conditions
- This problem occurs if the following six conditions are satisfied:
-
| (1) | Any of the -O, -O1 through -05, -OR, and -OS optimizing options is used. |
| (2) | Two or more assignment statements are written successively. |
| (3) | The destination of the first assignment statement (assignment statement A) and the source of the second assignment statement (assignment statement B) are the same auto variable (variable C). |
| (4) | The source of assignment statement A is either an array or a indirection reference, and variable C is used as the offset of the array or the indirection reference. |
| (5) | A memory address is allocated to variable C. |
| (6) | The type of variable C is any of the following and is not qualified as volatile:
unsigned char, signed char,
unsigned int, signed int,
unsigned short, signed short,
unsigned long, signed long,
unsigned long long, and signed long long
|
- Example
-
--------------------------------------------------------
extern char bbb;
extern char aaa[];
void func(void)
{
char c; /* Condition (6) */
c = aaa[c]; /* Conditions (2), (3), and (4) */
bbb = c; /* Conditions (2), and (3) */
}
--------------------------------------------------------
- Workaround
- Place a dummy asm function between two successive assignment statements.
-
--------------------------------------------------------
void func(void)
{
char c;
c = aaa[c];
asm(); /* Dummy asm function */
bbb = c;
}
--------------------------------------------------------
- Schedule of Fixing the Problem
We plan to fix this problem in our next release of the product.
|
 |