Fixes are available
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
LI76467
Reported component name
XL FORTRAN LINU
Reported component ID
5724X1600
Reported release
D10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2011-10-24
Closed date
2011-10-24
Last modified date
2011-10-24
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
XL FORTRAN LINU
Fixed component ID
5724X1600
Applicable component levels
RD10 PSY
UP
[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSAT4T","label":"XL Fortran for Linux"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"D10","Line of Business":{"code":"LOB57","label":"Power"}}]
Document Information
Modified date:
17 October 2021