Fixes are available
October 2010 PTF for XL C/C++ for AIX, V10.1
October 2010 PTF for XL C for AIX, V10.1
May 2012 PTF for XL C/C++ for AIX, V10.1
January 2013 PTF for XL C for AIX, V10.1
January 2013 PTF for XL C/C++ for AIX, V10.1
XL C/C++ for AIX Fix Pack 18 (July 2013 PTF) for 10.1
XL C/C++ for AIX Fix Pack 19 (October 2013 PTF) for 10.1
XL C/C++ for AIX Fix Pack 21 (October 2015 PTF) for 10.1
XL C for AIX Fix Pack 21 (October 2015 PTF) for 10.1
March 2010 PTF for XL C for AIX, V10.1
March 2010 PTF for XL C/C++ for AIX, V10.1
April 2010 PTF for XL C for AIX, V10.1
April 2010 PTF for XL C/C++ for AIX, V10.1
June 2010 PTF for XL C/C++ for AIX, V10.1
June 2010 PTF for XL C for AIX, V10.1
February 2011 PTF for XL C for AIX, V10.1
May 2011 PTF for XL C/C++ for AIX, V10.1
May 2011 PTF for XL C for AIX, V10.1
October 2011 PTF for XL C/C++ for AIX, V10.1
October 2011 PTF for XL C for AIX, V10.1
February 2012 PTF for XL C for AIX, V10.1
February 2012 PTF for XL C/C++ for AIX, V10.1
May 2012 PTF for XL C for AIX, V10.1
September 2012 PTF for XL C for AIX, V10.1
September 2012 PTF for XL C/C++ for AIX, V10.1
XL C for AIX Fix Pack 18 (July 2013 PTF) for 10.1
XL C for AIX Fix Pack 19 (October 2013 PTF) for 10.1
XL C for AIX Fix Pack 20 (October 2014 PTF) for 10.1
XL C/C++ for AIX Fix Pack 20 (October 2014 PTF) for 10.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
IZ67880
Reported component name
XL C++ AIX
Reported component ID
5724U8100
Reported release
A10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2010-01-12
Closed date
2010-02-24
Last modified date
2010-03-03
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 AIX
Fixed component ID
5724U8000
Applicable component levels
Document Information
Modified date:
07 October 2021