IBM Support

IJ24655: DIVIDE VECTORIZATION CAUSING UNEXPECTED DIVIDE BY ZERO FP EXCEPTION

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When compiling with -O3 and HOT optimization, multiple double
    floating point divide operations are combined into a single
    vector instruction.  In the example code, to avoid an exception,
    divide-by-zero cases are protected with an IF condition:
    
        for (i = 0; i < len; i++) {
    
            if (value[i] != 0.0)
                result[i] /= value[i];
            else
                result[i] = 0.0;
        }
    
    The code generated respects the zero-case scenario logically,
    however the bad vectorized divide operation still occurs, thus
    triggering a runtime floating point exception.
    

Local fix

  • Lower optimization level
    

Problem summary

  • PROBLEM DESCRIPTION:
    The IPA component of the compiler is optimizing the looping
    divide using vector instructions unsafely.
    
    USERS AFFECTED:
    Users compiling code at O3 and up.
    

Problem conclusion

  • The fix was to identify the unsafe operations in the control
    flow in the loop, and mark the unsafe operations un-simdizable.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IJ24655

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

    LI81271

  • 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