IBM Support

IJ24657: 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

    IJ24657

  • Reported component name

    XL C/C++ FOR AI

  • Reported component ID

    5725C7200

  • Reported release

    G10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2020-04-30

  • Closed date

    2020-04-30

  • Last modified date

    2020-04-30

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

    LI81412

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

Fix information

  • Fixed component name

    XL C/C++ FOR AI

  • Fixed component ID

    5725C7200

Applicable component levels

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSC6KWF","label":"XL C\/C++ for AIX"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
01 May 2020