This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Unit at a time C++ again


On Wed, 2003-06-18 at 23:19, Jan Hubicka wrote:
> > On Wed, 2003-06-18 at 05:26, Jan Hubicka wrote:
> > > Mark,
> > > after some frustration I got back to the unit-at-a-time and it appears
> > > difficult to get there without doing quite a lot of intrusive modifications at
> > > once, so I would like to discuss with you a plan whether it is possible to get
> > > unit-at-a-time working with gcc-3.4 timeframe (it would be nice to do as it
> > > would be easier to modify inlining heuristics to avoid some dead ends we are
> > > seeing now).
> > 
> > As I said before, I don't think we should consider this work until it
> > handles both template instantiation and data emission.  Otherwise, we're
> 
> OK, dealing with template instantiation should not be too dificult (I
> think I can simply instantiate all templates with the code I am having
> right now).  Dealing with at least needed portion of the datastructures
> should not be impossible, but I would like first to understand what
> exactly it does buy to us...

The template instantiation part of the issue is pretty clear: in big C++
programs many (if not most) of the functions are template
instantiations.  Trying to make decisions before template instantiation
is not worth it.

Data structures are also important because they can trigger template
instantiations.  A simple example is:

  template <typename T> void f(T) {}
  
  void (*fp)(int) = &f<int>;

Often, that kind of thing results in the instantiations of lots of
additional functions, as one function calls another and so forth.

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]