*******************************************************************************
*** GNU17 BUG REPORT **********************************************************
*******************************************************************************
Registration No.    :C17_003_compiler
Issue and revision  :2008/6/23

--- <Tool name / Object version> ----------------------------------------------
GNU17V1.2.0 or earlier

--- <Content> -----------------------------------------------------------------
A variable cast from double / long long type is not passed rightly to a 
subroutine.
This bug occurs by not only explicit conversion but also implicit conversion.

--- <Generation condition> ----------------------------------------------------
When all the following conditions are filled.

* Pass a variable cast from double / long long type to a subroutine as 2nd 
  parameter or later.
* Parameters before the variable cast from double / long are over 4 word,
  so they are stored in the stack.
  See the compiler package manual "6.4.3 Method of Using Registers" about the
  cases stored in the stack.
  In the case of a structure before the cast variable, a member variable is
  double / long long type.
* Cast to the following type when the cast variable is double type.
    char / int / short / long / unsigned char / unsigned short / unsigned int 
    unsigned long / float
  Cast to the following type when the cast variable is long long type.
    float

sample code:
  void sub( double arg1, int arg2 );

  int main( void )
  {
      double d = 1.0;

      sub( d, d );   // The value of the 2nd "d" is not passed rightly to the
                     // sub() function.
                     // The second "d" is cast to int type by implicit 
                     // conversion, so the same bug as sample code-1 occurs.
                     // The same error occurs whether it is defined as 
                     // "sub( d, (int)d )".

--- <Temporary Measures> ------------------------------------------------------
Assign a cast variable to a work variable, and pass it to the subroutine.

sample code:
  void sub( double arg1, int arg2 );

  int main( void )
  {
      double d = 1.0;
      int i_wk;
      
      i_wk = (int)d;
      sub( d, i_wk );     // The second parameter is passed rightly to sub 
                          // function by using a work variable.

--- <About the correction version> --------------------------------------------
Patch: None
Product version: Undecided

