Fixes are available
April 2012 PTF for XL C/C++ for AIX, V11.1
July 2012 PTF for XL C/C++ for AIX, V11.1
October 2012 PTF for XL C/C++ for AIX, V11.1
February 2013 PTF for XL C/C++ for AIX, V11.1
XL C/C++ for AIX Fix Pack 14 (May 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 15 (August 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 16 (November 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 17 (February 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 18 (May 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 19 (August 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 20 (November 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 21 (April 2015 PTF) for 11.1
XL C/C++ for AIX Fix Pack 22 (September 2015 PTF) for 11.1
XL C/C++ for AIX Fix Pack 23 (March 2016 PTF) for 11.1
XL C/C++ for AIX Fix Pack 24 (September 2016 PTF) for 11.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
IV18591
Reported component name
XL C/C++ AIX
Reported component ID
5724X1300
Reported release
B10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2012-03-29
Closed date
2012-03-29
Last modified date
2012-03-29
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++ AIX
Fixed component ID
5724X1300
Applicable component levels
RB10 PSN U851438
UP06/09/13 C
Document Information
Modified date:
29 March 2012