Fixes are available
November 2010 PTF for XL C/C++ Enterprise Edition for AIX, V9.0
November 2010 PTF for XL C Enterprise Edition for AIX, V9.0
March 2011 PTF for XL C/C++ Enterprise Edition for AIX, V9.0
March 2011 PTF for XL C Enterprise Edition for AIX, V9.0
July 2011 PTF for XL C/C++ Enterprise Edition for AIX, V9.0
December 2011 PTF for XL C/C++ Enterprise Edition for AIX, V9.0
March 2012 PTF for XL C Enterprise Edition for AIX, V9.0
March 2012 PTF for XL C/C++ Enterprise Edition for AIX, V9.0
May 2010 PTF for XL C/C++ Enterprise Edition for AIX, V9.0
May 2010 PTF for XL C Enterprise Edition for AIX, V9.0
August 2010 PTF for XL C/C++ Enterprise Edition for AIX, V9.0
August 2010 PTF for XL C Enterprise Edition for AIX, V9.0
July 2011 PTF for XL C Enterprise Edition for AIX, V9.0
December 2011 PTF for XL C Enterprise Edition for AIX, V9.0
APAR status
Closed as program error.
Error description
When compiling the following test case with -qhot=level=1 (level 1 is implied when using -qhot), the 'if (!b && a)' statement is evaluating as true. ====== TEST CASE ====== #include <stdio.h> long subr(long a, long b) { long i; for (i = 0; i < 1; i++) { printf (" 1: b = %d a = %d\n", b, a); if (!b && !a) printf (" 2: b = %d a = %d !!! \n", b, a); if (!b && a) printf (" 3: b = %d a = %d !!! \n", b, a); } return 0; } int main() { subr(0, 1); return 0; }
Local fix
Compile with the lower HOT level, -qhot=level=0. Higher optimization levels such as -O4 and -O5 implicitly set level=1. This option can be used to force level 0.
Problem summary
USERS AFFECTED: Any user of -qhot PROBLEM DESCRIPTION: Unswitching produces incorrect results when a predicate and its exact negation both occur within a loop region where one of them is unswitched.
Problem conclusion
After moving an if statement outside of a region, the old statement needs to be folded. The problem was that the old statement (and others equivalent to it) were matched by value number. However, the compiler failed to distinguish between if(expr) and if(!expr) and so folded both. The correct behaviour is to only fold statements identical to the original statement that was unswitched.
Temporary fix
Comments
APAR Information
APAR number
IZ74915
Reported component name
XL C AIX
Reported component ID
5724S7000
Reported release
900
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2010-04-21
Closed date
2010-04-21
Last modified date
2010-04-21
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
5724S7000
Applicable component levels
Document Information
Modified date:
07 October 2021