 |
|
 |
RENESAS TOOL NEWS on February 16, 2005: RSO-M3T-NC308WA-050216D
A Note on Using C-Compiler Packages M3T-NC308WA and M3T-NC30WA
|
Please take note of the following problem in using the C-compiler packages
M3T-NC308WA and M3T-NC30WA:
- On successive statements each of which contains an operation of multiplication, addition, or subtraction between a variable of type float and a floating constant
- Products and Versions Concerned
M3T-NC308WA V.5.00 Release 1 through V.5.20 Release 1 (for the M32C/90, M32C/80 and M16C/80 series)
M3T-NC30WA V.5.00 Release 1 through V.5.30 Release 02 (for the M16C/60, M16C/30, M16C/Tiny, M16C/20, M16C/10 and R8C/Tiny series)
- Description
Successive statements each of which contains an operation of
multiplication, addition, or subtraction between a variable of type
float and a floating constant results in incorrect code being generated.
- 2.1 Conditions
- This problem occurs if the following conditions are all satisfied:
| (1) |
Any one or more of the optimizing options -O3, -O4, -O5, -OR and -OS are selected. |
| (2) |
Any of the following series of statements exists:
- Successive statements each of which contains an operation of multiplication between a variable of type float and a floating constant
- Successive statements each of which contains an operation of addition between a variable of type float and a floating constant
- Successive statements each of which contains an operation of subtraction between a variable of type float and a floating constant
|
| (3) |
The result of each operation in (2) is assigned to the same variable. |
- 2.2 Example
-
--------------------------------------------------------------------
float f;
void func(void)
{
f = f * 10; /* Conditions (2)-a and (3) */
f = f * 20; /* Conditions (2)-a and (3) */
}
--------------------------------------------------------------------
- Workaround
This problem can be circumvented in either of the following ways:
| (1) |
Insert a dummy asm function between two successive statements of operations.
Example:
--------------------------------------------------------------------
float f;
void func(void)
{
f = f * 10;
asm(); /* Dummy asm() inserted */
f = f * 20;
}
-------------------------------------------------------------------- |
| (2) |
Use compile option -Ono_break_souce_debug (-ONBSD) in addition. |
- Schedule of Fixing the Problem
We plan to fix this problem in our next release of the products.
|
 |