Programming Languages on Power

Power Programming Languages

IBM Power, including the AIX, IBM i, and Linux operating systems, support a wide range of programming languages, catering to both traditional enterprise applications and modern development needs.


#Power

 View Only
  • 1.  xlC INternal compiler error

    Posted Thu May 25, 2017 02:45 AM

    Originally posted by: unrue


    Dear IBM developers,

     

    I'm using XLC 13.5.1. Red Hat 7.2 version as SO.  Compiling a cpp file I get the follow error:

     

    /opt/ibm/xlC/13.1.5/bin/.orig/xlC_r: error: 1501-230 Internal compiler error; please contact your Service Representative. For more information visit:
    http://www.ibm.com/support/docview.wss?uid=swg21110810
    

    These are my compilation flags:

     

    -O3 -dM -Wall -pedantic -Werror -Wno-variadic-macros -Wno-long-long -std=c++11 -Wno-unused-local-typedefs -qpic
    

    I tried without any flags or debug flags but the problem remains. Unfortunately, this file is part of a big project, so it is quiet hard to extract a code sample to reproduce the error. Any idea? Thanks.


    #Ask-Question-Here--General-Compiler-Q-and-A
    #C/C++andFortran


  • 2.  Re: xlC INternal compiler error

    Posted Thu May 25, 2017 05:26 AM

    Originally posted by: GuoJiufu


    Hi Gabriele,

    Thank you for reporting this issue and sorry to hear that you are experiencing this issue.

    Please remove option -dM from your compilation flags, and use the -E option to get a single preprocessed file, e.g.:

    xlC_r -E test.cpp -O3 -Wall -pedantic -Werror -Wno-variadic-macros -Wno-long-long -std=c++11 -Wno-unused-local-typedefs -qpic > test.i
    

    Then, if this issue can be reproduced with test.i (e.g. using the code below), please send test.i to us to have a look (or if you prefer, you can reduce test.i to a minimal test case before sending):

    xlC_r -O3 -dM -Wall -pedantic -Werror -Wno-variadic-macros -Wno-long-long -std=c++11 -Wno-unused-local-typedefs -qpic -+ test.i
    

    #C/C++andFortran
    #Ask-Question-Here--General-Compiler-Q-and-A


  • 3.  Re: xlC INternal compiler error

    Posted Fri May 26, 2017 02:37 AM

    Originally posted by: unrue


    Hi GuoJiuFu. Thanks for the suggestions. I replicated the error using your command line.

     

    In attach the preprocessed file.


    #C/C++andFortran


  • 4.  Re: xlC INternal compiler error

    Posted Tue May 30, 2017 10:47 AM

    Originally posted by: camorton


    The problem is with the && operator used in the static initializer, the compiler is trying to handle the case where we only evaluate one side.   I can get a clean compile by eliminating it.

    last bit of preprocessed file with WA macro showing the workaround
    1) add lhs and rhs static members to hold the expression from each side of the && operator
    2) initialise the original static with lhs && rhs instead of the original expressions

    namespace rtm {
    namespace trace {
    # 26 "/home/cibo4/src/RTM-AllStars/RTM/trace/objective_function/l2norm.h"
    class L2Norm : public ObjectiveFunction, protected TransformationFromReferenceCommons
    {
        public:

     

     


            explicit L2Norm(const trace_map_type &references = trace_map_type());

            float operator()(const trace_list_type &input) const;

            ObjectiveFunction::clone_type clone(const trace_map_type &reference_traces) const;

            memento_type create_memento() const;

            void set_state(memento_type token);

        private:
            class Memento : public SerializableMemento { public: void deserialize(const boost::filesystem::path & path); void serialize(const boost::filesystem::path & path) const; bool has_state() const { return false; } void create_template(const boost::filesystem::path & path) const { } friend class L2Norm; };
            static bool m_is_registered;
            #ifdef WA
            static bool lhs;
            static bool rhs;
            #endif
    };
    }
    }
    # 2 "/home/cibo4/src/RTM-AllStars/RTM/trace/objective_function/l2norm.cpp" 2

    using namespace std;

    namespace rtm {
    namespace trace {

    #ifdef WA

       bool L2Norm::lhs( factory_type::get_instance().register_prototype("L2Norm", make_shared<L2Norm>())  );
       bool L2Norm::rhs( factory_type::get_instance().register_prototype("L2Projection", make_shared<L2Norm>()) );
       bool L2Norm::m_is_registered(L2Norm::lhs && L2Norm::rhs);

    #else

    bool L2Norm::m_is_registered(
    factory_type::get_instance().register_prototype("L2Norm", make_shared<L2Norm>()) &&
    factory_type::get_instance().register_prototype("L2Projection", make_shared<L2Norm>())
    );
    #endif
    }
    }

     


    #Ask-Question-Here--General-Compiler-Q-and-A
    #C/C++andFortran


  • 5.  Re: xlC INternal compiler error

    Posted Mon June 05, 2017 04:19 AM

    Originally posted by: unrue


    Great camorton! It works. Sincerly, thanks thanks for your help :)


    #C/C++andFortran
    #Ask-Question-Here--General-Compiler-Q-and-A