Fixes are available
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
When using optimization with inlining, an inline ASM statement is not being inserted into the generated code. The cause seems related to code function inlining efforts and optimization by the compiler. === EXAMPLE === (Note: example is not compilable) ---------------------------- __asm__ ("sld %0,%1,%2" : "=r"(a) : "r"(a), "r"(z) : ); Uint64 c, d; __asm__("srd %0,%1,%2" : "=r"(c) : "r"(b),"r"(z) : ); __asm__("sld %0,%1,%2" : "=r"(d) : "r"(b),"r"(z) : ); a |= (c | d); __asm__("sld %0,%1,%2" : "=r"(b) : "r"(b), "r"(z) : ); ---------------------------- In this case, the last inline ASM statement is not being generated in the compiled code: ---------------------------- 661| 0034C4 sld 7D663036 1 ASM gr6='sld %0,%1,%2'r r r:,1,gr11,gr6 911| 0034C8 ori 612A0000 1 LR gr10=gr9 1235| 0034CC rlwinm 54BFFF3E 1 RN4 gr31=gr5,31,0xF 667| 0034D0 srd 7D284436 1 ASM gr8='srd %0,%1,%2,'r r r:,2,gr9,gr8 668| 0034D4 sld 7D296036 1 ASM gr9='sld %0,%1,%2,'r r r:,3,gr9,gr12 # LOGICAL "OR" OPERATIONS FOR 'a' 669| 0034D8 or 7D084B78 1 O gr8=gr8,gr9 911| 0034DC ori 6149000C 1 OIL gr9=gr10,0xC 669| 0034E0 or 7CC64378 1 O gr6=gr6,gr8 # BUT NO 4TH ASM STATEMENT 912| 0034E4 or 7C004B78 1 O gr0=gr0,gr9 669| 0034E8 std F8C1FFA0 1 ST8 <a5:d112:l8>(gr1,-96)=gr6 465| 0034EC cntlzd 7CC80074 1 CNTLZ8 gr8=gr6 465| 0034F0 cntlzd 7C0A0074 1 CNTLZ8 gr10=gr0 ----------------------------
Local fix
Do not use optimization.
Problem summary
PROBLEM DESCRIPTION: A incorrect code interpretation results in an incorrect internal code representation for the function with the inline ASM statement. Subsequent code optimizations may optimize away the inline ASM statement. USERS AFFECTED: Users with inline ASM statements with code inlining enabled.
Problem conclusion
The issue was fixed and the inline ASM is now generated correctly.
Temporary fix
Comments
APAR Information
APAR number
IV77968
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
2015-10-13
Closed date
2015-10-14
Last modified date
2015-10-14
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
UP
[{"Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSGH3R","label":"XL C\/C++ for AIX"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"13.1"}]
Document Information
Modified date:
02 October 2021