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: [tree-ssa-branch]: Patch for misc things


On Thu, 8 Aug 2002, Diego Novillo wrote:

> On Thu, 08 Aug 2002, Daniel Berlin wrote:
> 
> > Fixes a few things, adds the find_expr_in_tree change we talked about.
> > 
> I'll recap for the benefit of the list:
> 
> 	- find_expr_in_tree should also be allowed to follow
> 	  TREE_CHAINs for statements within a single scope.
> 
Right.
But only for levels > 0 (IE it should only go into substatements of the 
passed in statement, not sibling statements of the passed in statement).

> 	- To do this, we pass a recursion level argument.
Right.

> 
> 	- Inserting before a FOR_EXPR didn't work because
> 	  find_first_exec_stmt was not doing the right thing.

Correct.
I had also reversed two arguments for insert_before (pasto, i never 
switched them, so it was inserting *after*, not before).

> 
> Is that about right?
> 
> 
> > 2002-08-08  Daniel Berlin  <dberlin@dberlin.org>
> > 
> >         * tree-cfg.c (find_expr_in_tree_helper): Renamed from find_expr_in_tree.
> >         (find_expr_in_tree): Redone.
> > 
> You know.  I've been thinking about this today.  This function is
> remarkably similar to walk_tree.  I think it would be better to
> re-implement it as a callback for walk_tree.  But this is OK for
> now.
> 
> Frankly, I'd like to shred insert_* and re-write them from
> scratch.

I'm with you on this one.
Since we shouldn't have critical edges around , one idea that i'm gonna 
throw out (it just popped into my head, it my be a good idea, might be 
a horrible one. Feel free to rip it to shreds) is to just track the 
insertion point in varrefs.
I.E. Each varref has an insertion point structure, shared between varrefs 
for a given statement/expression.

The insertion point structure contains pointers to functions that 
know how to insert before/after the given statement, as well as the data 
necessary.

So for a varref in the FOR_EXPR, we'd either need pointers to functions 
that handle creating the COMPOUND_EXPR if necessary, adding to it 
otherwise.

I'm just trying to minimize the knowledge required in any specific 
insertion function, such that they don't become these complex evil 
beasts.  They only would need to know to insert for their particular 
case.

--Dan


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