 |
|
 |
RENESAS TOOL NEWS on October 16, 2003: RSO-M3T-NC308WA_2-031016D
A Note on Using C Compilers M3T-NC308WA and M3T-NC30WA
|
Please take note of the following problem in using the M3T-NC308WA and M3T-NC30WA C compilers (with an assembler and integrated development environment):
- On the division and remainder operations between constants
- Products and Versions Concerned
The M3T-NC308WA V.5.00 Release 1 and V.5.10 Release 1 for the M32C/80 and M16C/80 series
The M3T-NC30WA V.5.00 Release 1 through V.5.20 Release 1
for the M16C/60, M16C/30, M16C/Tiny, M16C/20, M16C/10, and R8C/Tiny series
- Description
A division or remainder operation between constants may results in an error.
- 2.1 Conditions
- This problem occurs if the following three conditions are satisfied:
| (1) | In the program exists an expression containing a division or remainder operation between constants. |
| (2) | Either the dividend or the divisor of the division or remainder operation is of type signed long long or unsigned long long. |
| (3) | The upper 32 bits of the dividend is neither 0 nor 0xffffffff. |
- 2.2 Example
------------------------------------------------------------------
long long l;
main()
{
l = 900000000000000LL/9000000; /* Conditions (1), (2), and (3) */
}
------------------------------------------------------------------
- Workaround
Replace the expression of the division or remainder operation with its result.
-------------------------------------------------------------
long long l;
main()
{
l = 100000000; /* Replaced with the result of division */
}
-------------------------------------------------------------
- Schedule of Fixing the Problem
We plan to fix this problem in our next release of the products.
|
 |