IBM Support

IZ60196: COMILE TIME ERROR WITH ASM AND -Q64

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The compiler generates error messages for the following
    test case in 64bit that uses asm statements:
    
    ===== COMPILE COMMAND:
    xlC_r -q64 -o test test.cpp
    
    ===== TESTCASE:
    ====Start of test.cpp=====
    #include <iostream>
    
    using namespace std;
    
    class base0
    {
        public:
            virtual void setUp(){};
    };
    
    class base1{
        public:
            virtual void anyFunc(){};
            ~base1(){};
    };
    
    template<typename T>
    class base2{
        public:
            virtual ~base2(){};
            virtual void helloWorld(){
                asm("lwsync");   //<--error due to the following
                return;
            }
    };
    
    template<typename T, typename C>
    class child: public base0, public base1, public base2<T>{
        private:
            C c1;
        public:
            int doSomething(){return 7;}
            void setUp(){};
            virtual ~child(){};
    };
    
    template<typename T>
    class paraTempl{
        public:
            int para;
    };
    
    
    int main(int argc, char *argv[]){
        child<paraTempl<int>, int> c;
        std::cout << c.doSomething();
        c.setUp();
        c.anyFunc();
        return 0;
    }
    ========End of test.cpp===================
    
    ===== ACTUAL OUTPUT:
    $xlC_r -q64 -o test test.cpp
    Assembler:
    test.s: line 12082: 1252-023 The symbol
    __dt__5childXT9paraTemplXTi_Ti_F__t16_v__Fv is not defined.
    test.s: line 12082: 1252-040 The specified expression is not
    valid.
            Make sure that all symbols are defined.
            Check the rules on symbols used in an arithmetic
    expression
            concerning relocation.
    test.s: line 12665: 1252-023 The symbol
    __dt__5childXT9paraTemplXTi_Ti_F__t16_v__Fv is not defined.
    test.s: line 12665: 1252-040 The specified expression is not
    valid.
            Make sure that all symbols are defined.
            Check the rules on symbols used in an arithmetic
    expression
            concerning relocation.
        1500-067: (S) asm statement generates errors in assembler
    output.
    
    
    
    ===== EXPECTED OUTPUT:
    Should compile clean
    

Local fix

  • You can use built-ins to work around this issue.
    
    You will need to add:
    #include <builtins.h>
    
    and instead of
    
    asm("lwsync");
    
    replease it with the following built-in
    
    __lwsync();
    

Problem summary

  • Users using asm with -q64 may be affected by this issue.
    
    The compiler optimizer was not able to handle thunks with asm
    generated by the front end.
    This resulted in a serious of compile time errors produced by
    the assembler during compile time.
    

Problem conclusion

  • The compiler optimizer has been fixed to handle thunks with asm.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IZ60196

  • Reported component name

    XL C++ AIX

  • Reported component ID

    5724U8100

  • Reported release

    A10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2009-09-07

  • Closed date

    2009-11-16

  • Last modified date

    2009-11-16

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

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

    LI75112 LI75152

Fix information

  • Fixed component name

    XL C AIX

  • Fixed component ID

    5724U8000

Applicable component levels

[{"Line of Business":{"code":"LOB08","label":"Cognitive Systems"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"A.1"}]

Document Information

Modified date:
04 October 2021