 |
|
 |
RENESAS TOOL NEWS [July 16, 2003: RSO-M3T-CC32R-030716D]
|
A Note on Using Cross-Tool Kit M3T-CC32R
|
Please take note of the following problem in using the M3T-CC32R cross-tool kit for the M32R family MCUs:
- On compiling a switch statement containing 415 or more case labels
- Versions Concerned
M3T-CC32R V.4.00 Release 1 and V.4.10 Release 1
- Description
When a switch statement containing 415 or more case labels is compiled with the level 4 option selected, the compiler returns a "1" that refers to an error and discontinues its operation. At this time, no error message is displayed.
If the TM "builds" or the make command "makes" a program including such a switch statement, the build or make operation halts displaying a message saying the compiler has returned an error.
- 2.1 Conditions
- This problem occurs if the following three conditions are satisfied:
| (1) | Any optimizing option covering the -O4 option's function (-O4, -O5, -O6, -O7, -Otime only or -Ospace only) is selected at compilation. |
| (2) | The -noinline option that suppresses the inline expansion function is not selected at compilation. |
| (3) | In the program exists a switch statement that contains 415 or more case labels. |
- 2.2 Example
Source file: sample.c
--------------------------------------------------------------
int x;
void func(void)
{
switch(x) {
case 1: /* Condition (3) */
;
case 2: /* Condition (3) */
;
case 3: /* Condition (3) */
;
case 4: /* Condition (3) */
;
// :
// :
// (Omitted)
// :
// :
case 415: /* Condition (3) */
;
}
}
--------------------------------------------------------------
- In the above sample.c file, the statements of cases 5 through 414 are omitted for simplicity. We furnish the complete sample.c file that is sure to raise this problem. Then, download it from HERE and see the problem occurs.
- Workaround
- This problem can be circumvented in any of the following ways:
| (1) | Select the -noinline option to suppress the inline expansion function. Selecting the -noinline option neglects the keyword "inline". However, because this does not produce any error, you need not modify the source program containing this keyword. |
| (2) | Don't use the -O4, -O5, -O6 or -O7 optimizing option. If you want to use -Otime or -Ospace, select any of these options, -O0, -O1, -O2, and -O3, at the same time. |
| (3) | Split the case labels into more than one switch statement so that no switch statement would contain 415 or more case labels. |
Example: Modification of sample.c
--------------------------------------------------------------
int x;
void func(void)
{
switch(x) {
case 1:
;
case 2:
;
}
switch(x) { /* Another switch statement created
to contain cases 3 through 415 */
case 3:
;
case 4:
;
// :
// :
// (Omitted)
// :
// :
case 415:
;
}
}
--------------------------------------------------------------
- Schedule of Fixing the Problem
We plan to fix this problem in our next release of the product.
|
 |