IV37232: INCORRECT OUTPUT FROM FORTRAN/C BINDING PROCEDURE WITH -O
Fixes are available
XL Fortran for AIX Fix Pack 5 (September 2013 PTF) for 14.1
XL Fortran for AIX Fix Pack 10 (February 2015 PTF) for 14.1
XL Fortran for AIX Fix Pack 11 (May 2015 PTF) for 14.1
XL Fortran for AIX Fix Pack 12 (August 2015 Update) for 14.1
XL Fortran for AIX Fix Pack 14 (December 2015 Update) for 14.1
XL Fortran for AIX Fix Pack 15 (April 2016 Update) for 14.1
XL Fortran for AIX Fix Pack 16 (July 2016 Update) for 14.1
XL Fortran for AIX Fix Pack 17 (November 2016 Update) for 14.1
Closed as program error.
A testcase is composed of a C program and a Fortran program. In the Fortran source code, an array of C-type pointers is defined. The malloc() function from libc is called to allocate each of these pointers and the array is displayed to the user in two ways 1. With a Fortran function 2. With a C function When both C and Fortran source files are compiled with no optimization (-O0) then both functions show the same results. However, wrong runtime results are displayed for the C function if optimizatino is used to compile the Fortran program.
Alter the code to pass elements of the array one by one to the C function.
PROBLEM DESCRIPTION: when passing a pointer structure member as argument to a bind(c) procedure, wrong values are received on the C side USERS AFFECTED: Any user who passes a structure member to a bind(c) procedure and compiles at -O2 and above
The problem has been fixed. Apply applicable service.
Reported component name
XL FORTRAN FOR
Reported component ID
Last modified date
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fixed component name
XL FORTRAN FOR
Fixed component ID
Applicable component levels
RE10 PSY U859152