Fixes are available
XL C/C++ for AIX Fix Pack 14 (December 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 15 (April 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/C++ for AIX Fix Pack 18 (February 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 19 (August 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 20 (March 2018 Update) for 12.1
XL C/C++ for AIX Fix Pack 21 (January 2019 Update) for 12.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
USERS AFFECTED: Users who have ASM statemetns and compile with inlining or any optimization related to inlining could be affected by this issue. PROBLEM DESCRIPTION: The compiler was failing to generate an extra ASM statement in the object code listing resulting in undefined behavior.
Problem conclusion
The compiler issue has been fixed.
Temporary fix
Comments
APAR Information
APAR number
IV77965
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
Submitted date
2015-10-13
Closed date
2015-12-30
Last modified date
2015-12-30
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
RC10 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":"12.1"}]
Document Information
Modified date:
02 October 2021