Fixes are available
June 2011 Update for XL C/C++ for Linux, V10.1
XL C/C++ for Linux Fix Pack 8 (January 2014 Update) for 10.1
August 2010 Update for XL C/C++ for Linux, V10.1
January 2011 Update for XL C/C++ for Linux, V10.1
January 2012 Update for XL C/C++ for Linux, V10.1
July 2012 Update for XL C/C++ for Linux, V10.1
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
LI75554
Reported component name
XL C/C++ RHEL52
Reported component ID
5724U8310
Reported release
A10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2010-07-28
Closed date
2010-07-28
Last modified date
2010-07-28
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++ RHEL52
Fixed component ID
5724U8310
Applicable component levels
RA10 PSN IZ72118
UP06/09/13
[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"A.1","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]
Document Information
Modified date:
17 October 2021