IBM Support

LI77596: INFINITE LOOP WITH -QIPA AND RELINK

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When compiling and linking with -qipa and relink, the comparison
    in the while loop (in the test case below) is not being
    satisfied which leads to an infinite loop.
    
    
    ===== COMPILE COMMAND:
    
    xlc_r -qutf -qcpluscmt  -O -qfdpr -qstrict -qlibansi
    -qinlglue -qmaxmem=8192 -qarch=ppc -qtune=balanced -qspill=2560
    -qsaveopt -qipa=level=0:inline=noauto -qlanglvl=stdc89
    -qlonglong -bcdtors:mbr::s -bweaklocal -q64 -brtl  -bbigtoc
    -qipa=relink -qdebug=timing -qpdf1=pdfname=test.pdf1
    -qipa=level=0 -lperfstat -lrt -lwlm -lpthread -lm test.c
    
    ===== TESTCASE:
    $ cat test.c
    #include <stdio.h>
    
    int main (int argc, const char* argv[] )
    {
            unsigned char a = 254;
            while( a != (unsigned char)255){
                    printf("counter: %d\n", (unsigned int)a);
                    a--;
            }
    }
    $
    
    
    ===== ACTUAL OUTPUT:
    Infinite loop
    
    
    ===== EXPECTED OUTPUT:
    No infinite loop
    

Local fix

  • N/A
    

Problem summary

  • USERS AFFECTED:
    Any user that has loop counters less than size int that
    overflow and the user invokes TPO via  -O3, -O4, -O5 or -qipa
    can be affected by this issue.
    
    PROBLEM DESCRIPTION:
    Loop normalization does not expect loop counters to overflow,
    and thus generates bad code.
    

Problem conclusion

  • The above issue has been corrected within the IPA component of
    the compiler.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI77596

  • Reported component name

    XL C/C++ FOR LI

  • Reported component ID

    5725C7300

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-10-28

  • Closed date

    2013-10-28

  • Last modified date

    2013-10-28

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

    IV39402

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

Fix information

  • Fixed component name

    XL C/C++ FOR LI

  • Fixed component ID

    5725C7300

Applicable component levels

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

Document Information

Modified date:
13 October 2021