Fixes are available
June 2011 Update for XL C/C++ for Linux, V10.1
XL C/C++ for Linux Fix Pack 8 (January 2014 Update) for 10.1
August 2010 Update for XL C/C++ for Linux, V10.1
January 2011 Update for XL C/C++ for Linux, V10.1
January 2012 Update for XL C/C++ for Linux, V10.1
July 2012 Update for XL C/C++ for Linux, V10.1
APAR status
Closed as program error.
Error description
The following test case involves array calculations and produces an incorrect output for both C and C++ at -O and up. =========Compile Line: xlC -O test.cpp =========Test Case: $ cat test.cpp #include <stdio.h> static int interpolate_sol( /* double** sol, */ double *sol[], int nsl, int nsu, int nv, double* sg, double* xg, double* vg, double** solp, double* sgp, double* xgp, double* vgp ); static int interpolate_sol( /* double** sol, */ double *sol[], int nsl, int nsu, int nv, double* sg, double* xg, double* vg, double** solp, double* sgp, double* xgp, double* vgp ) { /* assume the interval vg is inside vgp */ int vj[ 1000 ]; int i, j, k, n; k = 1; for( j=0; j<nv; ++j) { while( vg[j] > vgp[k] ) ++k; vj[j] = k; } n = 1; for( i=nsl; i<nsu; ++i) { while( sg[i] > sgp[n] ) ++n; for( j=0; j<nv; ++j ) { k = vj[j]; /* grid point (i,j) in sg x vg is inside the rectangle (n-1,k-1) (n,k) in sgp x vgp */ /***/ sol[0][0] = /***/ (solp[n-1][k-1] * (sgp[n]-sg[i] )* (vgp[k]-vg[j]) + solp[n ][k-1] * (sg[i]- sgp[n-1])* (vgp[k]-vg[j]) + solp[n-1][k ] * (sgp[n]-sg[i] )* (vg[j]-vgp[k-1])+ solp[n ][k ] * (sg[i]- sgp[n-1])* (vg[j]-vgp[k-1]) ) /( (sgp[n]- sgp[n-1])* (vgp[k]-vgp[k-1])); if (j==0) fprintf(stderr,"sgp[%i] = %g \n",n, sgp[n]); } } /***for(i=0;i<100;i++) fprintf(stdout,"#sgp[%i] = %g \n",i, sgp[i]);***/ return 0; } int main() { double sg[100],vg[100],xg[100]; double sgp[100],vgp[100],xgp[100]; double *sol[100], *solp[100]; double soldata[100][100], solpdata[100][100]; int i,j; for (i=0; i<100; i++) { sg[i] = sgp[i] = xg[i] = xgp[i] = vg[i] = vgp[i] = i; sol[i] = &soldata[i][0]; solp[i] = &solpdata[i][0]; for (j=0; j<100; j++) { solp[i][j] = i+j; } } interpolate_sol( sol, 0, 100, 100, sg, xg, vg, solp, sgp, xgp, vgp ); /***for(i=0;i<100;i++) fprintf(stdout,"*sgp[%i] = %g \n",i, sgp[i]);***/ return 0; } $ ========Actual Output: $./a.out sgp[1] = 1 sgp[1] = 1 sgp[2] = 1 sgp[3] = 1 sgp[4] = 1 sgp[5] = 1 sgp[6] = 1 ... sgp[94] = 1 sgp[95] = 1 sgp[96] = 1 sgp[97] = 1 sgp[98] = 1 sgp[99] = 1 $ ========Expected Output: $./a.out sgp[1] = 1 sgp[1] = 1 sgp[2] = 2 sgp[3] = 3 sgp[4] = 4 sgp[5] = 5 sgp[6] = 6 sgp[7] = 7 sgp[8] = 8 sgp[9] = 9 sgp[10] = 10 sgp[11] = 11 ... sgp[96] = 96 sgp[97] = 97 sgp[98] = 98 sgp[99] = 99 $
Local fix
N/A
Problem summary
USERS AFFECTED: Users of -O or higher can be affected by this issue. PROBLEM DESCRIPTION: The compiler optimizer performs an incorrect transformation in one of its internal algorithms causing the unexpected output with optimization.
Problem conclusion
The optimizer has been corrected to fix the incorrect transformation it was previously performing.
Temporary fix
Comments
APAR Information
APAR number
LI75572
Reported component name
XL C/C++ RHEL52
Reported component ID
5724U8310
Reported release
A10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2010-07-28
Closed date
2010-07-28
Last modified date
2010-07-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 C/C++ RHEL52
Fixed component ID
5724U8310
Applicable component levels
RA10 PSN IZ67880
UP06/09/13
[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"A.1","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]
Document Information
Modified date:
17 October 2021