This Question is Possibly Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
2 Replies Last post: Nov 23, 2009 11:09 PM by Chris_Donawa  
Click to view billburos's profile   3 posts since
Dec 8, 2008

Feb 27, 2009 9:35 AM

Very long compile times in -O2 for C++

Got this question over on the Linux on Power developerworks forum...

Running on sles 10 sp1, power 5 system, xlc ver 9.0 ...

http://www.ibm.com/developerworks/forums/thread.jspa?threadID=252961

date ; xlC_r -I./include -I../idl -O2 -g -q64 -qminimaltoc -qpic -D_REENTRANT -D_GNU_SOURCE -c ir.cc -o ir.o -qmaxmem=-1 ; date

which results in...

Thu Feb 26 17:50:13 CET 2009

1500-029: (W) WARNING: subprogram std::__destroy_aux<__gnu_cxx::__normal_iterator<ObjVar<CORBA::AbstractInterfaceDef> *,std::vector<ObjVar<CORBA::AbstractInterfaceDef>,std::allocator<ObjVar<CORBA::AbstractInterfaceDef> > > > >(__normal_iterator<ObjVar<CORBA::AbstractInterfaceDef> *,std::vector<ObjVar<CORBA::AbstractInterfaceDef>,std::allocator<ObjVar<CORBA::AbstractInterfaceDef> > > >, __normal_iterator<ObjVar<CORBA::AbstractInterfaceDef> *,std::vector<ObjVar<CORBA::AbstractInterfaceDef>,std::allocator<ObjVar<CORBA::AbstractInterfaceDef> > > >, __false_type) could not be inlined into std::_Destroy<__gnu_cxx::__normal_iterator<ObjVar<CORBA::AbstractInterfaceDef> *,std::vector<ObjVar<CORBA::AbstractInterfaceDef>,std::allocator<ObjVar<CORBA::AbstractInterfaceDef> > > > >(__normal_iterator<ObjVar<CORBA::AbstractInterfaceDef> *,std::vector<ObjVar<CORBA::AbstractInterfaceDef>,std::allocator<ObjVar<CORBA::AbstractInterfaceDef> > > >, __normal_iterator<ObjVar<CORBA::AbstractInterfaceDef> *,std::vector<ObjVar<CORBA::AbstractInterfaceDef>,std::allocator<ObjVar<CORBA::AbstractInterfaceDef> > > >).

1500-029: (W) WARNING: subprogram std::__destroy_aux<__gnu_cxx::__normal_iterator<ObjVar<CORBA::ExceptionDef> *,std::vector<ObjVar<CORBA::ExceptionDef>,std::allocator<ObjVar<CORBA::ExceptionDef> > > > >(__normal_iterator<ObjVar<CORBA::ExceptionDef> *,std::vector<ObjVar<CORBA::ExceptionDef>,std::allocator<ObjVar<CORBA::ExceptionDef> > > >, __normal_iterator<ObjVar<CORBA::ExceptionDef> *,std::vector<ObjVar<CORBA::ExceptionDef>,std::allocator<ObjVar<CORBA::ExceptionDef> > > >, __false_type) could not be inlined into std::vector<ObjVar<CORBA::ExceptionDef>,std::allocator<ObjVar<CORBA::ExceptionDef> > >::operator=(*const* vector<ObjVar<CORBA::ExceptionDef>,std::allocator<ObjVar<CORBA::ExceptionDef> > > &).

1500-029: (W) WARNING: subprogram std::__destroy_aux<__gnu_cxx::__normal_iterator<ObjVar<CORBA::LocalInterfaceDef> *,std::vector<ObjVar<CORBA::LocalInterfaceDef>,std::allocator<ObjVar<CORBA::LocalInterfaceDef> > > > >(__normal_iterator<ObjVar<CORBA::LocalInterfaceDef> *,std::vector<ObjVar<CORBA::LocalInterfaceDef>,std::allocator<ObjVar<CORBA::LocalInterfaceDef> > > >, __normal_iterator<ObjVar<CORBA::LocalInterfaceDef> *,std::vector<ObjVar<CORBA::LocalInterfaceDef>,std::allocator<ObjVar<CORBA::LocalInterfaceDef> > > >, __false_type) could not be inlined into std::_Destroy<__gnu_cxx::__normal_iterator<ObjVar<CORBA::LocalInterfaceDef> *,std::vector<ObjVar<CORBA::LocalInterfaceDef>,std::allocator<ObjVar<CORBA::LocalInterfaceDef> > > > >(__normal_iterator<ObjVar<CORBA::LocalInterfaceDef> *,std::vector<ObjVar<CORBA::LocalInterfaceDef>,std::allocator<ObjVar<CORBA::LocalInterfaceDef> > > >, __normal_iterator<ObjVar<CORBA::LocalInterfaceDef> *,std::vector<ObjVar<CORBA::LocalInterfaceDef>,std::allocator<ObjVar<CORBA::LocalInterfaceDef> > > >).

1500-029: (W) WARNING: subprogram std::__destroy_aux<__gnu_cxx::__normal_iterator<CORBA::Container::Description *,std::vector<CORBA::Container::Description,std::allocator<CORBA::Container::Description> > > >(__normal_iterator<CORBA::Container::Description *,std::vector<CORBA::Container::Description,std::allocator<CORBA::Container::Description> > >, __normal_iterator<CORBA::Container::Description *,std::vector<CORBA::Container::Description,std::allocator<CORBA::Container::Description> > >, __false_type) could not be inlined into std::_Destroy<__gnu_cxx::__normal_iterator<CORBA::Container::Description *,std::vector<CORBA::Container::Description,std::allocator<CORBA::Container::Description> > > >(__normal_iterator<CORBA::Container::Description *,std::vector<CORBA::Container::Description,std::allocator<CORBA::Container::Description> > >, __normal_iterator<CORBA::Container::Description *,std::vector<CORBA::Container::Description,std::allocator<CORBA::Container::Description> > >).

1500-029: (W) WARNING: subprogram std::__destroy_aux<__gnu_cxx::__normal_iterator<ObjVar<CORBA::ValueDef> *,std::vector<ObjVar<CORBA::ValueDef>,std::allocator<ObjVar<CORBA::ValueDef> > > > >(__normal_iterator<ObjVar<CORBA::ValueDef> *,std::vector<ObjVar<CORBA::ValueDef>,std::allocator<ObjVar<CORBA::ValueDef> > > >, __normal_iterator<ObjVar<CORBA::ValueDef> *,std::vector<ObjVar<CORBA::ValueDef>,std::allocator<ObjVar<CORBA::ValueDef> > > >, __false_type) could not be inlined into std::_Destroy<__gnu_cxx::__normal_iterator<ObjVar<CORBA::ValueDef> *,std::vector<ObjVar<CORBA::ValueDef>,std::allocator<ObjVar<CORBA::ValueDef> > > > >(__normal_iterator<ObjVar<CORBA::ValueDef> *,std::vector<ObjVar<CORBA::ValueDef>,std::allocator<ObjVar<CORBA::ValueDef> > > >, __normal_iterator<ObjVar<CORBA::ValueDef> *,std::vector<ObjVar<CORBA::ValueDef>,std::allocator<ObjVar<CORBA::ValueDef> > > >).

1500-029: (W) WARNING: subprogram std::__destroy_aux<__gnu_cxx::__normal_iterator<CORBA::String_var *,std::vector<CORBA::String_var,std::allocator<CORBA::String_var> > > >(__normal_iterator<CORBA::String_var *,std::vector<CORBA::String_var,std::allocator<CORBA::String_var> > >, __normal_iterator<CORBA::String_var *,std::vector<CORBA::String_var,std::allocator<CORBA::String_var> > >, __false_type) could not be inlined into std::_Destroy<__gnu_cxx::__normal_iterator<CORBA::String_var *,std::vector<CORBA::String_var,std::allocator<CORBA::String_var> > > >(__normal_iterator<CORBA::String_var *,std::vector<CORBA::String_var,std::allocator<CORBA::String_var> > >, __normal_iterator<CORBA::String_var *,std::vector<CORBA::String_var,std::allocator<CORBA::String_var> > >).

1500-029: (W) WARNING: subprogram std::__destroy_aux<__gnu_cxx::__normal_iterator<ObjVar<CORBA::InterfaceDef> *,std::vector<ObjVar<CORBA::InterfaceDef>,std::allocator<ObjVar<CORBA::InterfaceDef> > > > >(__normal_iterator<ObjVar<CORBA::InterfaceDef> *,std::vector<ObjVar<CORBA::InterfaceDef>,std::allocator<ObjVar<CORBA::InterfaceDef> > > >, __normal_iterator<ObjVar<CORBA::InterfaceDef> *,std::vector<ObjVar<CORBA::InterfaceDef>,std::allocator<ObjVar<CORBA::InterfaceDef> > > >, __false_type) could not be inlined into std::_Destroy<__gnu_cxx::__normal_iterator<ObjVar<CORBA::InterfaceDef> *,std::vector<ObjVar<CORBA::InterfaceDef>,std::allocator<ObjVar<CORBA::InterfaceDef> > > > >(__normal_iterator<ObjVar<CORBA::InterfaceDef> *,std::vector<ObjVar<CORBA::InterfaceDef>,std::allocator<ObjVar<CORBA::InterfaceDef> > > >, __normal_iterator<ObjVar<CORBA::InterfaceDef> *,std::vector<ObjVar<CORBA::InterfaceDef>,std::allocator<ObjVar<CORBA::InterfaceDef> > > >).

1500-029: (W) WARNING: subprogram std::__destroy_aux<__gnu_cxx::__normal_iterator<ObjVar<CORBA::ExceptionDef> *,std::vector<ObjVar<CORBA::ExceptionDef>,std::allocator<ObjVar<CORBA::ExceptionDef> > > > >(__normal_iterator<ObjVar<CORBA::ExceptionDef> *,std::vector<ObjVar<CORBA::ExceptionDef>,std::allocator<ObjVar<CORBA::ExceptionDef> > > >, __normal_iterator<ObjVar<CORBA::ExceptionDef> *,std::vector<ObjVar<CORBA::ExceptionDef>,std::allocator<ObjVar<CORBA::ExceptionDef> > > >, __false_type) could not be inlined into std::_Destroy<__gnu_cxx::__normal_iterator<ObjVar<CORBA::ExceptionDef> *,std::vector<ObjVar<CORBA::ExceptionDef>,std::allocator<ObjVar<CORBA::ExceptionDef> > > > >(__normal_iterator<ObjVar<CORBA::ExceptionDef> *,std::vector<ObjVar<CORBA::ExceptionDef>,std::allocator<ObjVar<CORBA::ExceptionDef> > > >, __normal_iterator<ObjVar<CORBA::ExceptionDef> *,std::vector<ObjVar<CORBA::ExceptionDef>,std::allocator<ObjVar<CORBA::ExceptionDef> > > >).

1500-029: (W) WARNING: subprogram std::__destroy_aux<__gnu_cxx::__normal_iterator<CORBA::Initializer *,std::vector<CORBA::Initializer,std::allocator<CORBA::Initializer> > > >(__normal_iterator<CORBA::Initializer *,std::vector<CORBA::Initializer,std::allocator<CORBA::Initializer> > >, __normal_iterator<CORBA::Initializer *,std::vector<CORBA::Initializer,std::allocator<CORBA::Initializer> > >, __false_type) could not be inlined into std::_Destroy<__gnu_cxx::__normal_iterator<CORBA::Initializer *,std::vector<CORBA::Initializer,std::allocator<CORBA::Initializer> > > >(__normal_iterator<CORBA::Initializer *,std::vector<CORBA::Initializer,std::allocator<CORBA::Initializer> > >, __normal_iterator<CORBA::Initializer *,std::vector<CORBA::Initializer,std::allocator<CORBA::Initializer> > >).

1501-201: (W) Maximum number of common component diagnostics, 10 has been exceeded.

Fri Feb 27 00:56:05 CET 2009

the original question on the post..

I don't understand why my source C++ code don't compile quickly in O2 optimization.

in O2 : 8 hours.
in O0 : 10 seconds.

What are the intrinsic option of O2 more than O0 ?

It's a source code that provide from the free library mico.

it's about 5000 lines.

I check with some options to suppress the inlining...

Click to view Raul_Silvera's profile   7 posts since
Nov 6, 2008
1. Mar 1, 2009 9:23 PM in response to: billburos
Re: Very long compile times in -O2 for C++
Optimization will generally increase the compiler requirements in terms of system resources and compile time. Many of the algorithms used during optimization are exponential in nature, so very large translation units may introduce this type of issues. Something to note with C++ is that due to template instantiation or inlining, the amount of code the compiler must optimize may not be proportional to the size of the source file being compiled.

Generally, the strategy to enable optimization in this type of situations is to split the file into multiple smaller files. I realize that this may not be feasible on all situations, and I must admit that these numbers seem extreme, so if you want to pursue this further please get in contact with IBM service to determine exactly what may be happening on this specific situation.
Click to view Chris_Donawa's profile   2 posts since
Mar 31, 2009
2. Nov 23, 2009 11:09 PM in response to: billburos
Re: Very long compile times in -O2 for C++

You can also try -qtempinc -qtempmax=X, where X is some large number > 1 e.g.

"-qtempinc -qtempmax=50"

See XLC C++ large compilation times when using -O2 and up

Bottom Banner