Fixes are available
May 2012 PTF for XL C/C++ for AIX, V10.1
January 2013 PTF for XL C/C++ for AIX, V10.1
XL C/C++ for AIX Fix Pack 18 (July 2013 PTF) for 10.1
XL C/C++ for AIX Fix Pack 19 (October 2013 PTF) for 10.1
XL C/C++ for AIX Fix Pack 21 (October 2015 PTF) for 10.1
February 2012 PTF for XL C/C++ for AIX, V10.1
September 2012 PTF for XL C/C++ for AIX, V10.1
XL C/C++ for AIX Fix Pack 20 (October 2014 PTF) for 10.1
APAR status
Closed as program error.
Error description
The compiler fails to compile correctly when there is a use of [name] and when the operand has a "+" and uses a memory constraint. The following test case demonstrates the issue: ===== COMPILE COMMAND: xlC_r test_m.cpp ===== TESTCASE: $cat test_m.cpp inline static void store_timestamp(unsigned long *buffer) { asm( " ldx 5,%[buffer] \n\t" /* get old value */ " mfctr 6 \n\t" /* get new timer value */ " subf 6,5,6 \n\t" /* calc new - old */ " stdx 6,%[buffer] \n\t" /* and save */ : [buffer] "+m" (*buffer) /* outputs */ : /* inputs */ : "r5", "r6" /* clobbered */ ); return; } inline static void inc_atomic(unsigned long volatile *ctr) { asm( " lwsync \n\t" "1: ldarx 5,%[ctr] \n\t" // get old ctr and reserve " addi 6,5,1 \n\t" // increment " stdcx. 6,%[ctr] \n\t" // store updated value " bne 1b \n\t" // reservation lost? -> retry " isync \n\t" : [ctr] "+m" (*ctr) /* outputs */ : /* inputs */ : "cr0", "r5", "r6" /* clobbered */ ); return; } inline static void add_atomic(unsigned long volatile *sum, unsigned long inc) { asm( " lwsync \n\t" "1: ldarx 5,%[sum] \n\t" // get old ctr and reserve " add 6,5,[inc] \n\t" // increment " stdcx. 6,%[sum] \n\t" // store updated value " bne 1b \n\t" // reservation lost? -> retry " isync \n\t" : [sum] "+m" (*sum) /* outputs */ : [inc] "b" (inc) /* inputs */ : "cr0", "r5", "r6" /* clobbered */ ); return; } int main() { unsigned long * temp1 = 0; unsigned long volatile * temp2 = 0; unsigned long temp3 = 0; store_timestamp(temp1); inc_atomic(temp2); add_atomic(temp2, temp3); return 0; } $ ===== ACTUAL OUTPUT: $ xlC_r test_m.cpp "test_m.cpp", line 7.11: 1540-0548 (S) The symbolic name buffer used in a %[name] operand specifier is duplicated. $ ===== EXPECTED OUTPUT: Should compile clean.
Local fix
n/a
Problem summary
USERS AFFECTED: Users who make use of duplicate symbols to represent output operand with matching constraint may be affected by this issue. PROBLEM DESCRIPTION: When output operands with +m constraints, the compiler converts output operands into input operands. The compiler then issues a diagnostic message on the duplicate symbols used for these kind of input operands.
Problem conclusion
Disable the compiler from issuing the error message when input operands has matching constraints.
Temporary fix
Comments
APAR Information
APAR number
IV12522
Reported component name
XL C++ AIX
Reported component ID
5724U8100
Reported release
A10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2011-12-21
Closed date
2012-01-26
Last modified date
2012-01-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++ AIX
Fixed component ID
5724U8100
Applicable component levels
[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"A.1","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]
Document Information
Modified date:
26 January 2012