IBM Support

LI77059: INCORRECT OUTPUT WITH -O2

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • Consider the following testcase:
    
    
    /////////////////////// test.c //////////////////////////////
    #include <stdio.h>
    
    static unsigned long long f(unsigned b, unsigned long long ys)
    {
     unsigned long long y = b - (ys & 0xFFFFFFFFULL);
     return (y >> 32) & 1;
    }
    
    int main()
    {
     printf("%llu\n", f(0x75600000U, 0x1E0800000ULL));
     return 0;
    }
    //////////////////////////////////////////////////////////////
    
    
    Compile the source file with -O (-O2):
    
    xlc -O -q64 -o di3 di3.c&&  ./di3
    
    The compiler incorrectly outputs 0. The correct output should
    be: 1. The issue is not reproduced with higher optimization (-O3
    and up) or with no optimization turned on.
    

Local fix

  • Do not turn optimization on, or use -O3 and higher.
    

Problem summary

  • The compiler fixload problem.
    

Problem conclusion

  • The problem is fixed
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI77059

  • Reported component name

    XL C/C++ FOR LI

  • Reported component ID

    5724X1400

  • Reported release

    B10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2012-10-10

  • Closed date

    2012-10-10

  • Last modified date

    2012-10-10

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

    IV20818

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

Fix information

  • Fixed component name

    XL C/C++ FOR LI

  • Fixed component ID

    5724X1400

Applicable component levels



Document information

More support for: XL C/C++ for Linux

Software version: B10

Reference #: LI77059

Modified date: 10 October 2012