Fixes are available
XL C/C++ for AIX Fix Pack 11 (February 2015 PTF) for 12.1
XL C for AIX Fix Pack 12 (May 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 12 (May 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 13 (August 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 14 (December 2015 Update) for 12.1
XL C for AIX Fix Pack 15 (April 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 15 (April 2016 Update) for 12.1
XL C for AIX Fix Pack 16 (July 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 16 (July 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 17 (November 2016 Update) for 12.1
XL C for AIX Fix Pack 17 (November 2016 Update) for 12.1
XL C for AIX Fix Pack 18 (February 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 18 (February 2017 Update) for 12.1
XL C for AIX Fix Pack 19 (August 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 19 (August 2017 Update) for 12.1
XL C for AIX Fix Pack 20 (March 2018 Update) for 12.1
XL C/C++ for AIX Fix Pack 20 (March 2018 Update) for 12.1
XL C for AIX Fix Pack 9 (July 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 9 (July 2014 PTF) for 12.1
XL C for AIX Fix Pack 10 (October 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 10 (October 2014 PTF) for 12.1
XL C for AIX Fix Pack 11 (February 2015 PTF) for 12.1
XL C for AIX Fix Pack 13 (August 2015 Update) for 12.1
XL C for AIX Fix Pack 14 (December 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 21 (January 2019 Update) for 12.1
XL C for AIX Fix Pack 21 (January 2019 Update) for 12.1
APAR status
Closed as program error.
Error description
Inefficient load from constant area on strcpy, memcpy, strncpy when copying string constant. Suggest to replace the constant area loads with constant constant construction using immediate instructions. Sample: void strcpy1638E(char *out) { strcpy(out, "1638E"); } Compiler generates: | 000000 PDEF strcpy1638E(char *) | 000000 AKA strcpy1638E__FPc 9| PROC out,gr3 0| 000040 ld E8820008 1 L8 gr4=.+CONSTANT_AREA(gr2,0) 398| 000044 lwa E804000A 1 L4A gr0=+CONSTANT_AREA(gr4,8) 398| 000048 lhz A084000C 1 L2Z gr4=+CONSTANT_AREA(gr4,12) 398| 00004C stw 90030000 1 ST4A (char)(gr3,0)=gr0 398| 000050 sth B0830004 1 ST2Z (char)(gr3,4)=gr4 12| 000054 bclr 4E800020 1 BA lr This causes constant area growth or utilizing TOC. And loads are dependant on constant area load.
Local fix
Use direct instructions to replace strcpy. void opt1638E(char *out) { const unsigned short c16 = '1' << 8 | '6'; const unsigned short c38 = '3' << 8 | '8'; const unsigned short cE = 'E' << 8; ((unsigned short *)out)[0] = c16; ((unsigned short *)out)[1] = c38; ((unsigned short *)out)[2] = cE; }
Problem summary
PROBLEM DESCRIPTION: Inefficient load from constant area on strcpy, memcpy, strncpy when copying string constant. This fix will replace the constant area loads with constant construction using immediate instructions. USERS AFFECTED: Users who use functions like strcpy, memcpy and strncpy etc. to copy a string literal into a memory area.
Problem conclusion
This fix will optimize loads of the tail of string literals into immediate instructions to get performance improved.
Temporary fix
Comments
APAR Information
APAR number
IV56281
Reported component name
XL C/C++ FOR AI
Reported component ID
5725C7200
Reported release
C10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt / Xsystem
Submitted date
2014-03-05
Closed date
2014-07-18
Last modified date
2014-07-18
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
RC10 PSY UP
C
Document Information
Modified date:
21 August 2024