IBM Support

PI58820: FLOATING POINT EXCEPTION NOT THROWN AT -O2

A fix is available

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When compiling at -O2, the resulting binary does not throw a
    floating point exception at runtime. We seem to be pre-computing
     a value and then printing it out during runtime.
    
    ===== TESTCASE:
    $ cat overflow2.cpp
    #include <stdio.h>
    int main (int argc, char* argv);
    
    int main (int argc, char* argv) {
            double f = 2.82e+41;
    
            printf("f is %f\n", f); fflush(stdout);
    
            f *= f;  // Expect to get HFP exponent overflow here
    
            printf("f is %f\n", f); fflush(stdout);
    
            return 0;
    }
    
    $
    
    
    
    ===== ACTUAL OUTPUT:
    $ ./overflow2opt1
    f is 282000000000000000000000000000000000000000.000000
    f is 0.000000
    
    
    
    ===== EXPECTED OUTPUT:
    $ ./overflow2opt0
    f is 282000000000000000000000000000000000000000.000000
    CEE3212S The system detected an exponent-overflow exception
    (System Completion Code=0CC).
             From entry point main at compile unit offset +00000070
    at entry offset +00000070 at address 2540A190.
    [1] + Done(136) ./overflow2opt0
      83889146      Floating point exception        ./overflow2opt0
    
    $
    

Local fix

  • N/A
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED: zOS C/C++ compiler users using hexadecimal   *
    *                 floating point format in programs that may   *
    *                 trigger floating point exceptions.           *
    ****************************************************************
    * PROBLEM DESCRIPTION: Failure to generate floating point      *
    *                      overflow exception when optimization    *
    *                      is performed.                           *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    

Problem conclusion

  • Apply provided service.
    

Temporary fix

Comments

APAR Information

  • APAR number

    PI58820

  • Reported component name

    C/C++ FOR MVS

  • Reported component ID

    56551210A

  • Reported release

    7A0

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-03-09

  • Closed date

    2016-03-09

  • Last modified date

    2016-06-04

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

    PI44210

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

Modules/Macros

  •    CCNETBY
    

Fix information

  • Fixed component name

    C/C++ FOR MVS

  • Fixed component ID

    56551210A

Applicable component levels

  • R7A0 PSY UI36029

       UP16/04/26 P F604

Fix is available

  • Select the PTF appropriate for your component level. You will be required to sign in. Distribution on physical media is not available in all countries.

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SG19M","label":"APARs - z\/OS environment"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7A0","Edition":"","Line of Business":{"code":"","label":""}},{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSQKCWV","label":"IBM C\/C++ for MVS\/ESA"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7A0","Edition":"","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Document Information

Modified date:
22 August 2024