IBM Support

LI75944: -QHOT OPTION CAUSING INCORRECT RESULT

Subscribe

You can track all active APARs for this component.

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

    LI75944

  • Reported component name

    XL C/C++ RHEL5

  • Reported component ID

    5724S7310

  • Reported release

    900

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-02-23

  • Closed date

    2011-02-23

  • Last modified date

    2011-02-23

  • APAR is sysrouted FROM one or more of the following:

    IZ72118

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    XL C/C++ RHEL5

  • Fixed component ID

    5724S7310

Applicable component levels



Document information

More support for: XL C/C++

Software version: 9.0

Reference #: LI75944

Modified date: 23 February 2011


Translate this page: