This is the mail archive of the gcc-patches@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 time compilation mode II


> On Tue, Feb 11, 2003 at 11:37:48AM +0100, Jan Hubicka wrote:
> > 	* Makefile.in (CRTSTUFF_CFLAGS): Add -fno-unit-at-time
> 
> Why did you need this?  If we failed to emit something, then it
> means that either we're missing an __attribute__((used)), or
> you've a bug in your callgraph code.

The problem is that code depends on few functions not being inlined and
changes sections using asm statements.  When I delay compilation, the
section changes ends up in wrong places.
> 
> > ! 	 Generate RTL for the body of this function or deffer
> 
> Typo for "defer".
> 
> > +   node = xcalloc (sizeof (*node), 1);
> 
> Reversed arguments.
> 
> > + /* Create edge from CALLER to CALLEE in the cgraph.  */
> > + 
> > + static void
> > + remove_edge (caller, callee)
> 
> Paste-o in comment.
> 
> > +   while (changed)
> > +     {
> > +       changed = false;
> > +       for (node = cgraph_nodes; node; node = node->next)
> > + 	{
> 	  ...
> > + 	  changed = true;
> 
> I think you want a work list instead.  Perhaps threaded through the
> nodes themselves, to avoid memory management hassles.  As is, you've
> got O(N**2) traversal.

I hope it is not too serious in this case as I am walking across
functions there should not be that many of them to make this matter.

The problem is that code lowering is allowed to make more functions
neccesary and create new functions (template instantiation).  So I would
have to organize worklist over all the contributing passes.
> 
> > + cgraph_expand_functions ()
> 
> I think you ought to split this apart into multiple sub functions.

I can definitly split out the first loop into something like
cgraph_mark_functions_to_output
but the rest is basically toplogical sorting algorithm except for the
expanding code itself, that can be cgraph_expand_function.
Does that seem enought?

Honza
> 
> The rest of it looks reasonable.
> 
> 
> r~


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