Fixes are available
January 2012 PTF for XL C/C++ for AIX, V11.1
April 2012 PTF for XL C/C++ for AIX, V11.1
July 2012 PTF for XL C/C++ for AIX, V11.1
October 2012 PTF for XL C/C++ for AIX, V11.1
February 2013 PTF for XL C/C++ for AIX, V11.1
XL C/C++ for AIX Fix Pack 14 (May 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 15 (August 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 16 (November 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 17 (February 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 18 (May 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 19 (August 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 20 (November 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 21 (April 2015 PTF) for 11.1
XL C/C++ for AIX Fix Pack 22 (September 2015 PTF) for 11.1
XL C/C++ for AIX Fix Pack 23 (March 2016 PTF) for 11.1
XL C/C++ for AIX Fix Pack 24 (September 2016 PTF) for 11.1
APAR status
Closed as program error.
Error description
Consider the following testcase: //////////////// test.cpp /////////////////// extern "C" int printf(const char *, ...); struct Date { Date(int i) : i_(i) { } friend inline Date foo(Date date, int secs); Date& operator +=(int secs); int i_; }; inline Date foo(Date date, int secs) { return date += secs; } Date& Date::operator+=(int secs) { i_ += secs; return *this; } int main() { Date now = Date(42); foo(now, 56); printf("%d\n", now.i_); } ///////////////////////////////////////////// Compile with optimization turned OFF: $xlC test.cpp $./a.out 42 // correct Compile with optimization turned ON: $xlC -O test.cpp $./a.out 98 // incorrect
Local fix
Do not turn on optimization
Problem summary
Front-end failed to create a temporary to latch an argument when inlining.
Problem conclusion
The fix is safe and the correct means of resolving the problem.
Temporary fix
Comments
APAR Information
APAR number
IV12899
Reported component name
XL C/C++ AIX
Reported component ID
5724X1300
Reported release
B10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2012-01-09
Closed date
2012-01-09
Last modified date
2012-01-09
APAR is sysrouted FROM one or more of the following:
IV10507
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
XL C/C++ AIX
Fixed component ID
5724X1300
Applicable component levels
RB10 PSY U849548
UP C
Document Information
Modified date:
09 January 2012