IBM Support

LI76237: COMPILING WITH IPA LEADS TO INCORRECT OUTPUT

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • The following test case demonstrates the inocorrect output:
    
    $cat test.c
    #include <stdio.h>
    
    int c;
    int cia();
    int check1();
    int check2();
    
    int foo() {
      unsigned g1=0, g2=0;
    
      if (check1()) { g1=1;}
      if (check2()) { g2=1;}
    
      unsigned char f1 = cia();
    
      if ((( (c?1:0) || g1 || g2) && (f1 ))) return 1;
      return 0;
    }
    
    
    int cia() { return 1; }
    int check1() { return 0;}
    int check2() { return 0;}
    
    int main() {
      c=1;
      printf("foo =  %d\n", foo());
    
      return 0;
    }
    
    ======ACTUAL OUTPUT:
    $xlc -+ test.c -q64 -qhot -qlist -qnoinline ; ./a.out
    foo =  0
    $
    
    ======EXPECTED OUTPUT:
    $./a.out
    foo =  1
    

Local fix

  • n/a
    

Problem summary

  • USERS AFFECTED:
    Users compiling the applications with ipa maybe affected by
    this issue.
    
    PROBLEM DESCRIPTION:
    A specific internal branching optimization was not merging the
    branches correctly while handling the first jump label.
    

Problem conclusion

  • The fix was to check if there is any jump to the label from
    outside of the predicate group when grouping the predicates
    with branch collapsing.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI76237

  • Reported component name

    XL C/C++ SLES10

  • Reported component ID

    5724U8300

  • Reported release

    A10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-06-10

  • Closed date

    2011-06-10

  • Last modified date

    2011-06-10

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

    IZ94357

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

Fix information

  • Fixed component name

    XL C/C++ SLES10

  • Fixed component ID

    5724U8300

Applicable component levels



Document information

More support for: XL C/C++

Software version: A.1

Reference #: LI76237

Modified date: 10 June 2011