IBM Support

IV56792: OPTIMIZATION CAUSES EXE TO HANG

Fixes are available

XL C for AIX Fix Pack 8 (March 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 8 (March 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 11 (February 2015 PTF) for 12.1
XL C for AIX Fix Pack 12 (May 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 12 (May 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 13 (August 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 14 (December 2015 Update) for 12.1
XL C for AIX Fix Pack 15 (April 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 15 (April 2016 Update) for 12.1
XL C for AIX Fix Pack 16 (July 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 16 (July 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 17 (November 2016 Update) for 12.1
XL C for AIX Fix Pack 17 (November 2016 Update) for 12.1
XL C for AIX Fix Pack 18 (February 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 18 (February 2017 Update) for 12.1
XL C for AIX Fix Pack 19 (August 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 19 (August 2017 Update) for 12.1
XL C for AIX Fix Pack 20 (March 2018 Update) for 12.1
XL C/C++ for AIX Fix Pack 20 (March 2018 Update) for 12.1
XL C for AIX Fix Pack 9 (July 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 9 (July 2014 PTF) for 12.1
XL C for AIX Fix Pack 10 (October 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 10 (October 2014 PTF) for 12.1
XL C for AIX Fix Pack 11 (February 2015 PTF) for 12.1
XL C for AIX Fix Pack 13 (August 2015 Update) for 12.1
XL C for AIX Fix Pack 14 (December 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 21 (January 2019 Update) for 12.1
XL C for AIX Fix Pack 21 (January 2019 Update) for 12.1

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When compiling the following two test cases with -O2, the
    resulting binaries hang at runtime.
    
    ===== COMPILE COMMAND:
    xlc_r -q64 -O2 test1.c
    xlc_r -q64 -O2 test2.c
    
    ===== TESTCASE:
    $ cat test1.c
    int main (void)
    {
        long x, x64 = (long)0xFFFFFFFFFFFFFFFFuLL;
        long andval = 0;
        do { x = __ldarx(&x64); } while (!__stdcx(&x64, (x &
    andval)));
        return (x64 == 0);
    }
    $
    
    $ cat test2.c
    int main (void)
    {
        int x, x32 = (int)0xFFFFFFFFu;
        int andval = 0;
        do { x = __lwarx(&x32); } while (!__stwcx(&x32, (x &
    andval)));
        return (x32 == 0);
    }
    $
    
    
    
    ===== ACTUAL OUTPUT:
    The resulting binaries hang at runtime
    
    
    ===== EXPECTED OUTPUT:
    The resulting binaries should not hang at runtime.
    

Local fix

  • N/A
    

Problem summary

  • USERS AFFECTED:
    Clients who use high optimization(-O2 and above) with programs
    that use store conditional return value which depends on load
    and reserve that may be discarded may be affected by this
    issue.
    
    PROBLEM DESCRIPTION:
    The optimization that optimizes the load and reserve
    instruction away causes some exes to hang.
    

Problem conclusion

  • The compiler has been fixed to prevent load and reserve from
    being discarded.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV56792

  • Reported component name

    XL C FOR AIX

  • Reported component ID

    5725C7100

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2014-03-18

  • Closed date

    2014-03-18

  • Last modified date

    2014-03-19

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

    IV52591

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

Fix information

  • Fixed component name

    XL C FOR AIX

  • Fixed component ID

    5725C7100

Applicable component levels

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

Document Information

Modified date:
02 October 2021