IBM Support

LI77889: __BUILTIN_FLOOR() TO ACCEPT AN INTEGER PARAMETER

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • Currently, when you specifiy an integer value to the floor()
    function, the compiler issues an error message as follows:
    
    ===== COMPILE COMMAND:
    bgxlC -c test.cpp
    
    ===== TESTCASE:
    $ cat test.cpp
    #include <stdio.h>
    #include <stdlib.h>
    #include <iostream>
    
    #include <cmath>
    using std::floor;
    
    
    
    int  main(int argc, char *argv[])
    {
       double d1, d2, d3;
       int i1, i2, i3;
       unsigned long ul1, ul2, ul3;
    
       d1 = 1.1; d2 = 2.9;
       i1=13; i2=5;
       ul1=737; ul2=47;
    
       //i3 = floor( d2 );
    
       i3 = floor( i1 );
    
       //i3 = floor( i1 / i2 );
    
       //if ( floor( i3/i2 ) != floor( i2/i1 ) )
      //    d3=d2/d1;
    
       ul3 = floor( ul1 );
    
       //ul3 = floor( ul1 / ul2 );
       //if ( floor( ul3/ul2 ) != floor( ul2/ul1 ) )
         // d1 = d3 * d2;
    
       return 0;
    
    }
    $
    
    ===== ACTUAL OUTPUT:
    $ bgxlC test2.cpp -c
    "/bgsys/drivers/ppcfloor/gnu-linux/lib/gcc/powerpc64-bgq-linux/4
    .4.7/../../../../powerpc64-bgq-linux/include/c++/4.4.7/cmath",
    line 269.14: 1540-0274 (S) The name lookup for "__builtin_floor"
    did not find a declaration.
    "/bgsys/drivers/ppcfloor/gnu-linux/lib/gcc/powerpc64-bgq-linux/4
    .4.7/../../../../powerpc64-bgq-linux/include/c++/4.4.7/cmath",
    line 268.5: 1540-0700 (I) The previous message was produced
    while processing "std::floor<int>(int)".
    "test.cpp", line 22.9: 1540-0700 (I) The previous message was
    produced while processing "main(int, char *[])".
    "/bgsys/drivers/ppcfloor/gnu-linux/lib/gcc/powerpc64-bgq-linux/4
    .4.7/../../../../powerpc64-bgq-linux/include/c++/4.4.7/cmath",
    line 269.14: 1540-0274 (S) The name lookup for "__builtin_floor"
    did not find a declaration.
    "/bgsys/drivers/ppcfloor/gnu-linux/lib/gcc/powerpc64-bgq-linux/4
    .4.7/../../../../powerpc64-bgq-linux/include/c++/4.4.7/cmath",
    line 268.5: 1540-0700 (I) The previous message was produced
    while processing "std::floor<unsigned long>(unsigned long)".
    "test.cpp", line 29.10: 1540-0700 (I) The previous message was
    produced while processing "main(int, char *[])".
    $
    
    ===== EXPECTED OUTPUT:
    Clean compile
    

Local fix

  • Cast the integer into a floating/double value.
    

Problem summary

  • USERS AFFECTED:
    Users who wish to pass in an integer parameter to floor() are
    affected by this issue.
    
    PROBLEM DESCRIPTION:
    The floor() function calls the internal  __builtin_floor()
    which was not taking int as a parameter.
    

Problem conclusion

  • The internal __builtin_floor() function now has a forward
    declaration which accepts integers.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI77889

  • Reported component name

    XL C/C++ FOR BG

  • Reported component ID

    5799AG100

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2014-04-04

  • Closed date

    2014-05-21

  • Last modified date

    2014-05-21

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

    IV62684

Fix information

  • Fixed component name

    XL C/C++ FOR BG

  • Fixed component ID

    5799AG100

Applicable component levels

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS2LWA","label":"XL C\/C++ for Blue Gene\/Q"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"12.1","Edition":"","Line of Business":{"code":"LOB73","label":"Power TPS"}}]

Document Information

Modified date:
05 September 2024