Tool News
 
 
 

Tool News

Products Info
Downloads
Tools FAQs
RENESAS TOOL NEWS on December 16, 2004: RSO-M3T-NC308WA_2-041216D

A Note on Using the M3T-NC308WA and
M3T-NC30WA C-Compiler Packages

--On Evaluation of Members of a Structure
in the Controlling Expression of an If Statement--

Please take note of the following problem in using the M3T-NC308WA and M3T-NC30WA C-compiler packages:
  • On evaluation of members of a structure in the controlling expression of an if statement


  1. Products and Versions Concerned
    M3T-NC308WA V.3.10 Release 1 through V.5.10 Release 1
    (for the M32C/90, M32C/80 and M16C/80 series)

    M3T-NC30WA V.5.00 Release 1 and V.5.10 Release 1
    (for the M16C/60, M16C/30, M16C/Tiny, M16C/20, M16C/10, and R8C/Tiny series)

  2. Description
    If two or more expressions testing equality or inequality between a member of a structure and a constant exist in the controlling expression of an if statement, incorrect code is generated.


  3. Conditions
    This problem occurs if the following conditions are all satisfied:
    (1)Two or more expressions testing equality or inequality between a member of a structure and a constant exist in the controlling expression of an if statement.
    (2) The members in (1) are of type unsigned char or signed char; not of type array.
    (3)The members in (1) are placed at successive addresses.
    (4) All the equality/inequality-testing expressions in (1) are associated with one another using the logical OR operators.
    (5) Compile option -O4 or -O5 is used; or any of those, -O1, -O2, -O3, -OR, and -OS, is used with -Ocompare_byte_to_word (-OCBTW).

    Example
    -------------------------------------------------------------------------
    struct       S
    {
         char    a;      /* Conditions (2) and (3) */
         char    b;      /* Conditions (2) and (3) */
         char    c;
    } s;
    
    int  i;
    
    void func(void)
    {
         if(( s.a == 0x01 ) || (s.b == 0x01)) /* Conditions (1) and (4) */
                 i = 10;
         else
                 i = 20;
    }
    -------------------------------------------------------------------------

  4. Workaround
    Use compile option -Ono_logical_or_combine (-ONLOC) in addition.


  5. Schedule of Fixing the Problem
    This problem has already been resolved in the V.5.20 Release 1 and later of both the M3T-NC308WA and M3T-NC30WA. So upgrade yours to these online from Software download for tools.





© 2008. Renesas Technology Corp., All rights reserved. Privacy | Legal