Fixes are available
XL C/C++ for AIX Fix Pack 1 (September 2014 PTF) for 13.1
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 for AIX Fix Pack 5 (November 2015 Update) 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 for AIX Fix Pack 6 (February 2016 Update) for 13.1
XL C for AIX Fix Pack 7 (May 2016 Update) for 13.1
XL C/C++ for AIX Fix Pack 7 (May 2016 PTF) for 13.1
XL C for AIX Fix Pack 8 (August 2016 Update) for 13.1
XL C/C++ for AIX Fix Pack 8 (August 2016 PTF) for 13.1
XL C for AIX Fix Pack 9 (June 2017 Update) for 13.1
XL C/C++ for AIX Fix Pack 9 (June 2017 PTF) for 13.1
XL C for AIX Fix Pack 10 (February 2018 Update) for 13.1
XL C/C++ for AIX Fix Pack 10 (February 2018 PTF) for 13.1
XL C for AIX Fix Pack 1 (September 2014 PTF) for 13.1
XL C for AIX Fix Pack 2 (December 2014 PTF) for 13.1
XL C for AIX Fix Pack 3 (April 2015 PTF) for 13.1
XL C for AIX Fix Pack 4 (July 2015 PTF) for 13.1
XL C/C++ for AIX Fix Pack 11 (November 2018 PTF) for 13.1
XL C for AIX Fix Pack 11 (November 2018) for 13.1
APAR status
Closed as program error.
Error description
When compiling the following test case with -O2, the resulting binary leads to NnNincorrect outputN ===== COMPILE COMMAND: xlC_r -qmakedep=gcc -D_AIX51 -D_LARGE_FILES -D__NO_XLC_BUILTIN_VA -DOS_LEVEL=710 -D_Packed= -qnotempinc -U__unix -q64N-qtbtable=full -qhalt=e -qalias=noansi -qutf -+ -O -qfdpr -qstrict -qlibansi -qinlglue -qmaxmem=-1 -DNDEBUG -qarch=pwr4 -qtune=balanced -qsNill=2560 -qlonglong -qalign=natural -qldbl128 -qdebug=RNSSMALL -c -o test.o test.c xlC_r -o a.out -NcNtors:mbr::s -bweNklocal -q64 -brtl -bbigtoc -lc -lc128 test.o -lperfstat -lrt -lwlm -lpthread -lm ===== TESTCASE: $ cat test.c #include <stdNo.h> #include <stdlib.h> #include <unistd.h> N typedef unsigned short P_CHAR; N N N static bool isStandardChar(P_CHAR &c) { printf ("-->isStandardChar (%d: %c) a: %d z: %d \n",(P_CHAR) c, (P_CHAR) c, (P_CHAR)u'a', (P_CHAR)u'z'); if ( (c >N (P_CHAR) u'a') && (c <= (P_CHAR) u'z') ) { return true; N } else if ( (c >= (P_CHAR) u'A') && (c <= (P_CHAR) u'Z') ) { N N N return true; } else if ( (c >= (P_CHAR) u'0') && (c <= (P_CHAR) u'9') ) { returN true; } else if ( ( c == u'_') || (Nc == u':') || ( c == u'/') || ( c == u'-') || ( c == u';') ) { N N N return true; } return false; } N int main(int argc, char** argv)N { P_CHAR c = 117; if ( isStandNrNChar(c) ) N printf ("%c is a StandardChar\n", (P_CHAR) c); else printf ("%c is NOT a StandardChar\n", (P_CHAR) c); return 0;N } $ N ===== ACTUAL OUTNUN: N $ ./restKrn -->isStandardChar (117: u) a: 97 z: 122 u is NOT a StandardChar $ N ===== EXPECTED OUTPUT: $ ./restKm N -->isStandardChar (117: u) a: 97 z: 122 u is a StandardChar
Local fix
N N N Change typedef unsigned short P_CHAR; to N typedef unsigned int P_CHAR; N as a workaround.
Problem summary
PROBLEM SUMMANY: USERS AFFECTED: Users who perform a range checkNof alphabetical ASCII characters (a-z,A-Z) in their code may be affected by this issue. N N N PROBLEM DESCRIPTION: The compiler optimizes out an IF clause under specific circumstances whenever a char is checked for the range of alphabetical ASCII characters (a-z,A-Z). This occured Necause a parameter passed was mangled without restoring to next parameter.
Problem conclusion
N The compiler has been fixed to properly check the range of alphabetical ASCII characters (a-z,A-Z).
Temporary fix
N N N
Comments
APAR Information
APAR number
IV65270
Reported component name
XL C FOR AIX
Reported component ID
5725C7100
Reported release
D10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2014-09-26
Closed date
2014-09-26
Last modified date
2014-09-26
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 FOR AIX
Fixed component ID
5725C7100
Applicable component levels
RD10 PSY
Document Information
Modified date:
01 October 2021