IBM Support

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

Subscribe

You can track all active APARs for this component.

 

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":"BU048","label":"IBM Software"},"Product":{"code":"SSGH3R","label":"XL C\/C++ for AIX"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Line of Business":{"code":"LOB73","label":"Power TPS"}}]

Document Information

Modified date:
22 August 2024