Fixes are available
APAR status
Closed as program error.
Error description
When compiling code that calls the C_F_POINTER procedure using an array result from an elemental function, the 'xlfhot' component of the compiler is encountering an internal error: $ cat test.f90 PROGRAM test USE iso_c_binding, ONLY: c_ptr, c_loc, c_f_pointer TYPE mytype INTEGER :: a, b END TYPE mytype TYPE(mytype) :: bla(2) INTEGER, TARGET :: baz(100, 100) INTEGER, POINTER :: q(:, :) TYPE(c_ptr) :: p bla = mytype(100, 1) p = C_LOC(baz) CALL C_F_POINTER(p, q, getfirst(bla)) CONTAINS ELEMENTAL FUNCTION getfirst(num) RESULT(a) TYPE(mytype), INTENT(in) :: num INTEGER :: a a = num%a END FUNCTION getfirst END PROGRAM test $ xlf2003 test.f90 ** test === End of Compilation 1 === 1585-100 Internal compiler error -- please contact your service representative. For more information visit: http://www.ibm.com/support/docview.wss?uid=swg21110810 1501-511 Compilation failed for file test.f90. $
Local fix
Create a temporary array calling the elemental function, then pass the array to C_F_POINTER: temp = getfirst(bla) CALL C_F_POINTER(p, q, temp)
Problem summary
PROBLEM DESCRIPTION: An internal compiler error is encountered when C_F_POINTER is called and the shape argument is a non-primary expression. USERS AFFECTED: Users who call C_F_POINTER and pass an expression in as the shape argument.
Problem conclusion
The compiler now creates a temporary to store the result of the expression before passing it to C_F_POINTER.
Temporary fix
Comments
APAR Information
APAR number
LI77665
Reported component name
XL FORTRAN LINU
Reported component ID
5725C7500
Reported release
E10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2013-10-28
Closed date
2013-10-28
Last modified date
2013-10-28
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
5725C7500
Applicable component levels
RE10 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":"14.1","Line of Business":{"code":"LOB57","label":"Power"}}]
Document Information
Modified date:
14 October 2021