IBM Support

LI77964: -QARCH=PWR7 HINDERS CALL OPTIMIZATION

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • When using the -qarch=pwr7 option for the following test case,
    the compiler does not optimize the strlenNC function.
    
    ===== COMPILE COMMAND:
    xlC -O2 -q64 -qlist test.cpp -qarch=pwr7 -c test.cpp
    
    ===== TESTCASE:
    
    $ cat test.cpp
    #include <string.h>
    
    
    extern "C" size_t wrap(const char *p)
    {
       return strlen(p);
    }
    
    
    extern "C" size_t strlenNC(const char *p)
    {
       return wrap(p);
    }
    $
    ===== ACTUAL OUTPUT:
    
    Output with xlC -O2 -q64 -qlist call.C -qarch=pwr7:
    
     GPR's set/used:   ss-s ssss ssss s---  ---- ---- ---- ----
     FPR's set/used:   ssss ssss ssss ss--  ---- ---- ---- ----
     CCR's set/used:   ss-- -sss
      VR's set/used:   ssss ssss ssss ssss  ssss ---- ---- ----
         | 000000                           PDEF     strlenNC
        8|                                  PROC      p,gr3
        0| 000040 mfspr    7C0802A6   1     LFLR      gr0=lr
        0| 000044 stdu     F821FF91   1     ST8U
    gr1,#stack(gr1,-112) =gr1
        0| 000048 std      F8010080   1     ST8
    #stack(gr1,128)=gr0
       11| 00004C addi     38210070   1     AI        gr1=gr1,112
       11| 000050 b        4BFFFFB0   1     CALLF
    gr3=wrap,1,(char)",gr3,#ProcAlias",wrap",fcr",gr1,cr[01567]",gr0
    ",gr4"-gr12",vs0"-vs13",mq",lr",fcr",xer",fsr",ca",ctr",nj",vs0"
    -vs13",vs32"-vs51"
       11|                              CL.3:
         |               Tag Table
    
    
    ===== EXPECTED OUTPUT:
    
    Expected output with xlC -O2 -q64 -qlist call.C:
     GPR's set/used:   su-s ssss ssss s---  ---- ---- ---- ----
     FPR's set/used:   ssss ssss ssss ss--  ---- ---- ---- ----
     CCR's set/used:   ss-- -sss
         | 000000                           PDEF     strlenNC
        8|                                  PROC      p,gr3
       11| 000040 b        4BFFFFC0   1     CALLF
    gr3=wrap,1,(char)",gr3,#ProcAlias",wrap",fcr",gr1,cr[01567]",gr0
    ",gr4"-gr12",fp0"-fp13",mq",lr",fcr",xer",fsr",ca",ctr"
       11|                              CL.3:
    

Local fix

  • N/A
    

Problem summary

  • USERS AFFECTED:
    Users who use the -qarch=pwr7 option are potentially affected
    by this issue.
    
    PROBLEM DESCRIPTION:
    Prologue in Epilogue generation was happening excessively
    because there was an OR allowing anything that was a vector to
    pass through.
    

Problem conclusion

  • The above has been fixed by adding in a compiler check.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI77964

  • 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

    2014-04-30

  • Closed date

    2014-04-30

  • Last modified date

    2014-04-30

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

    IV54884

  • 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



Document information

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

Software version: 12.1

Reference #: LI77964

Modified date: 30 April 2014