IBM Support

LI81412: IF CHECK MISSED WITH SIMD OPT CAUSING NEGATIVE VALUE TO VDFSQRT

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • When using -O3 with SIMD instructions enabled, an IF statement
    in a looping structure is used to check a potential negative
    divisor to avoid calculating a negative square root.  At lower
    optimization levels this works, however SIMD optimization are
    packaging a full vector's worth of data from the loop into a
    single vector operation, without checking the IF conditional.
    This is leading to a runtime Floating Point Exception.
    
    
       === TEST CODE SNIPPET ===
    
    for(i=0; i<m; i++)
    {
        if (dy[i] < 0.)     // MISSING THIS CHECK
            dy[i] = 0.;
        else
            dy[i] = sqrt(2*hn / dy[i]) ;
    }
    

Local fix

  • Lower optimization level, do not use SIMD
    

Problem summary

  • USERS AFFECTED:
    Users who make use of the sqrt operation and compile with -O3
    and SIMD may be affected by this issue.
    
    PROBLEM DESCRIPTION:
    An internal compiler optimization causes an 'if' check to be
    missed leading to a floating point exception.
    

Problem conclusion

  • The optimization has been modified to detect the sqrt operation
    and make necessary changes.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI81412

  • Reported component name

    XL C/C++ LINUX

  • Reported component ID

    5725C7310

  • Reported release

    G11

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2020-04-30

  • Closed date

    2020-06-23

  • Last modified date

    2020-06-23

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

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

    IJ24657

Fix information

  • Fixed component name

    XL C/C++ LINUX

  • Fixed component ID

    5725C7310

Applicable component levels

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSXVZZ","label":"XL C\/C++ for Linux"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"G11","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
24 June 2020