IBM Support

IV02380: INCORRECT TRAP WITH MAXVAL AND MINVAL

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When the either the MAXVAL or MINVAL functions are applied on
    NaN masked elements, an invalid exception is encountered during
    runtime.
    
    In the testcase below, 'tmparray' is a one-dimension array with
    two elements, the first of which is not explicitely assigned a
    value. Compiler option -qinitauto=7FBFFFFF is used to assign a
    float NaN to the first element.
    
    When compiling this test case with '-qflttrap=invalid:enable
    -qinitauto=7FBFFFFF -qnooptimize', an invalid exception is
    observed.
    
    
    ===== TESTCASE:
    program main
            real tmparray(2)
            tmparray(2) = 10.
            print *, maxval(tmparray, mask = (/.false., .true./))
    end program main
    
    
    ===== ACTUAL OUTPUT:
    $ xlf -qflttrap=invalid:enable -qinitauto=7FBFFFFF -qnooptimize
    main.f
    ** main   === End of Compilation 1 ===
    1501-510  Compilation successful for file main.f.
    $ ./a.out
    Trace/BPT trap (core dumped)
    $
    
    
    ===== EXPECTED OUTPUT:
    $ xlf -qflttrap=invalid:enable -qinitauto=7FBFFFFF -qnooptimize
    main.f
    ** main   === End of Compilation 1 ===
    1501-510  Compilation successful for file main.f.
    $ ./a.out
     10.00000000
    $
    

Local fix

  • Within the test case, replace:
    print *, maxval(tmparray, mask = (/.false., .true./))
    
    with
    print *, maxval(pack(tmparray, mask = (/.false., .true./)))
    

Problem summary

  • PROBLEM DESCRIPTION:
    The compiler is not generating a short circuiting AND on the
    user supplied MASK when expanding these intrinsics. This causes
    all portions of the expression determining the MAXVAL or MINVAL
    to be evaluated whether the user requested it or not. When this
    particular test case is run with these options, the runtime
    correctly traps on the yscal(1) as the user specified
    -qinitauto=7FBFFFFF (NaN).
    
    USERS AFFECTED:
    Users that debug using -qinitauto=7FBFFFFF
    -qflttrap=invalid:enable
    

Problem conclusion

  • The fix included generating a short circuiting AND on the user
    specified MASK, which stops the remainder of the expression
    from being evaluated.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV02380

  • Reported component name

    XL FORTRAN FOR

  • Reported component ID

    5724X1500

  • Reported release

    D10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-06-24

  • Closed date

    2011-11-02

  • Last modified date

    2011-11-03

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

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

    LI76467 LI76473 IV10112

Fix information

  • Fixed component name

    XL FORTRAN FOR

  • Fixed component ID

    5724X1500

Applicable component levels

  • RD10 PSY U848520

       UP A

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSGH4D","label":"XL Fortran for AIX"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"13.1","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
03 November 2011