IBM Support

IV20818: 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

    IV20818

  • Reported component name

    XL C/C++ AIX

  • Reported component ID

    5724X1300

  • Reported release

    B10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2012-05-08

  • Closed date

    2012-07-05

  • Last modified date

    2012-07-05

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

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

    LI77059

Fix information

  • Fixed component name

    XL C FOR AIX

  • Fixed component ID

    5724X1200

Applicable component levels

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSGH2K","label":"XL C for AIX"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.1","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
05 July 2012