Fixes are available
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
After enabling optimization on code that creates std::pair<> objects created using NULL pointers, object initialization code is optimized away and incorrect output is seen. ==== TEST CASE ==== #include <utility> #include <iostream> class Test; void g() { std::pair<int, Test*> tab[3] = { std::make_pair(1, (Test*)NULL), std::make_pair(1, (Test*)NULL), std::make_pair(1, (Test*)NULL) }; std::cout << tab[0].first << '\n'; std::cout << tab[0].second << '\n'; std::cout << tab[1].first << '\n'; std::cout << tab[1].second << '\n'; std::cout << tab[2].first << '\n'; std::cout << tab[2].second << '\n'; } int main() { g(); } $ xlC -q64 -O2 test.cpp $ ./a.out 1 0 1157627904 800200140000400 150994943 0 $
Local fix
Do no use optimization.
Problem summary
PROBLEM DESCRIPTION: Brace list array initialization is giving insufficient aliasing information to ensure program correctness. USERS AFFECTED: Runtime brace lists initializing an array of an aggregate type, compiled with optimization.
Problem conclusion
The aliasing issue was resolved, and correct behaviour is now given.
Temporary fix
Comments
APAR Information
APAR number
IV39827
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
2013-04-16
Closed date
2013-08-13
Last modified date
2013-08-13
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++ AIX
Fixed component ID
5724X1300
Applicable component levels
RB10 PSY U860996
UP C
Document Information
Modified date:
13 August 2013