Fixes are available
XL C/C++ for AIX Fix Pack 2 (December 2014 PTF) for 13.1
XL C/C++ for AIX Fix Pack 3 (April 2015 PTF) for 13.1
XL C/C++ for AIX Fix Pack 4 (July 2015 PTF) for 13.1
XL C/C++ for AIX Fix Pack 5 (November 2015 PTF) for 13.1
XL C/C++ for AIX Fix Pack 6 (February 2016 PTF) for 13.1
XL C/C++ for AIX Fix Pack 7 (May 2016 PTF) for 13.1
XL C/C++ for AIX Fix Pack 8 (August 2016 PTF) for 13.1
XL C/C++ for AIX Fix Pack 9 (June 2017 PTF) for 13.1
XL C/C++ for AIX Fix Pack 10 (February 2018 PTF) for 13.1
XL C/C++ for AIX Fix Pack 11 (November 2018 PTF) for 13.1
APAR status
Closed as program error.
Error description
The following test case reveals that the compiler is generating incorrect code when handling bit fields: ===== COMPILE COMMAND: cc -qlist -qsource -g -g -DISSUE -q64 -+ -c -o t.o t.c cc -g -o t_nak -q64 t.o ===== TESTCASE: #include <stdio.h> #include <limits.h> #define SIZE 20 typedef struct S0 { union { unsigned u : SIZE; unsigned short us; } u; } S0; int main(void) { S0 s; #ifdef ISSUE s.u.us = 1000; #endif s.u.u = 15; printf("%u\n", s.u.u); } ===== ACTUAL OUTPUT: $ ./build $ ./t_nak 0 $ ===== EXPECTED OUTPUT: $ ./build $ ./t_ack 15 $
Local fix
N/A
Problem summary
USERS AFFECTED: XL C++ users with bitfields may be affected by this issue. PROBLEM DESCRIPTION: Unions that are enclosed within another class or struct causes wrong bitcontainer to be emitted.
Problem conclusion
A compiler fix has been made to emit correct bitcontainer.
Temporary fix
Comments
APAR Information
APAR number
IV68013
Reported component name
XL C/C++ FOR AI
Reported component ID
5725C7200
Reported release
D10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2014-12-17
Closed date
2014-12-17
Last modified date
2014-12-17
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++ FOR AI
Fixed component ID
5725C7200
Applicable component levels
RD10 PSY
Document Information
Modified date:
03 October 2021