 |
|
 |
RENESAS TOOL NEWS on September 16, 2004: RSO-M3T-NC308WA_2-040916D
A Note on Using C Compiler Package M3T-NC308WA
|
Please take note of the following problem in using the M3T-NC308WA
C-compiler package with an assembler and integrated development environment:
- On a multiplication between variables of type long long
- Versions Concerned
M3T-NC308WA V.5.00 Release 1 through V.5.20 Release 1
- Description
A multiplication between variables of type long long may cause System Error to arise.
- 2.1 Conditions
- This problem occurs if the following conditions are all satisfied:
| (1) |
A multiplication between variables of type signed long long or those of unsigned long long is performed. |
| (2) |
Both the multiplier and multiplicand in (1) are originally of type
unsigned char, unsigned short, unsigned int, or unsigned long and
are converted to of type signed long long or unsigned long long
by zero extension. |
- 2.2 Example
-------------------------------------------------------------
long long ll;
unsigned long l,m;
void func( void )
{
ll = (long long)l * (long long)m; /* Conditions (1) and (2) */
}
-------------------------------------------------------------
- Workaround
Assign either the multiplier or the multiplicand to a temporary
variable, and then perform the multiplication using this temporary
variable.
-------------------------------------------------------------
long long ll;
unsigned long l,m;
void func( void )
{
long long tmp;
tmp = (long long)l;
ll = tmp * (long long)m;
}
-------------------------------------------------------------
- Schedule of Fixing the Problem
We plan to fix this problem in our next release of the product.
|
 |